shoot_projectile should work with entities better
LadyCailinBot opened this issue ยท 0 comments
CMDHELPER-3096 - Reported by PseudoKnight
Right now the function shoots projectiles if source is an entity and there's no target, but gives an error if a non-projectile is used in other cases (can be confusing, since the docs do not mention the inconsistency). Instead, it should choose the method based on whether it's a projectile and whether there's a target.
Maybe something roughly like this:
if instanceof projectile
if target
shootProjectile(projectile, vector) // maybe, needs testing
else
shootProjectile(projectile)
else
spawnEntity(loc, entity)
setVelocity(vector)