1 Year Ago
Fix entity spawning out of bounds (#1863) * Fix entity spawning out of bounds Fixes garrysmod-issues/issues/5028 * Don't edit trace result Fixes code to avoid changing the trace result. Removes the redundant OBBCenter() calculation, since it doesn't work until the entity is spawned. Moves entities 2 units closer to surface when spawn position is being corrected, to avoid DropToFloor() moving the entity out of bounds. * Make fix better conform to old behavior Makes it so that the new spawn position is offset even when aiming at an entity, like before. Also cleaner readability