NSProjectile: SpawnDef/SpawnDefAtPosition/SpawnDefAttachment will now return the resulting NSProjectile
This commit is contained in:
parent
dea5168998
commit
f1e47f9ea4
2 changed files with 20 additions and 7 deletions
|
@ -154,7 +154,7 @@ void NSProjectile_ReadEntity(bool);
|
|||
#endif
|
||||
|
||||
#ifdef SERVER
|
||||
void NSProjectile_SpawnDef(string entityDef, NSEntity theOwner);
|
||||
void NSProjectile_SpawnDefAtPosition(string entityDef, NSEntity theOwner, vector vecOrigin, vector vecAngles);
|
||||
void NSProjectile_SpawnDefAttachment(string entityDef, NSEntity theOwner, int attachmentID);
|
||||
NSProjectile NSProjectile_SpawnDef(string entityDef, NSEntity theOwner);
|
||||
NSProjectile NSProjectile_SpawnDefAtPosition(string entityDef, NSEntity theOwner, vector vecOrigin, vector vecAngles);
|
||||
NSProjectile NSProjectile_SpawnDefAttachment(string entityDef, NSEntity theOwner, int attachmentID);
|
||||
#endif
|
|
@ -813,18 +813,28 @@ NSProjectile_ReadEntity(bool new)
|
|||
#endif
|
||||
|
||||
#ifdef SERVER
|
||||
void
|
||||
NSProjectile
|
||||
NSProjectile_SpawnDef(string entityDef, NSEntity theOwner)
|
||||
{
|
||||
entity oldself = self;
|
||||
vector launchAngle;
|
||||
|
||||
NSProjectile rocket = spawn(NSProjectile);
|
||||
rocket.owner = theOwner;
|
||||
self = rocket;
|
||||
EntityDef_SpawnClassname(entityDef);
|
||||
self = oldself;
|
||||
rocket.Launch(theOwner.GetOrigin() + theOwner.view_ofs, theOwner.GetAngles(), 0.0f, 0.0f, 0.0f);
|
||||
|
||||
if (theOwner.flags & FL_CLIENT)
|
||||
launchAngle = theOwner.v_angle;
|
||||
else
|
||||
launchAngle = theOwner.GetAngles();
|
||||
|
||||
rocket.Launch(theOwner.GetOrigin() + theOwner.view_ofs, launchAngle, 0.0f, 0.0f, 0.0f);
|
||||
return rocket;
|
||||
}
|
||||
void
|
||||
|
||||
NSProjectile
|
||||
NSProjectile_SpawnDefAtPosition(string entityDef, NSEntity theOwner, vector vecOrigin, vector vecAngles)
|
||||
{
|
||||
entity oldself = self;
|
||||
|
@ -834,8 +844,10 @@ NSProjectile_SpawnDefAtPosition(string entityDef, NSEntity theOwner, vector vecO
|
|||
EntityDef_SpawnClassname(entityDef);
|
||||
self = oldself;
|
||||
rocket.Launch(vecOrigin, vecAngles, 0.0f, 0.0f, 0.0f);
|
||||
return rocket;
|
||||
}
|
||||
void
|
||||
|
||||
NSProjectile
|
||||
NSProjectile_SpawnDefAttachment(string entityDef, NSEntity theOwner, int attachmentID)
|
||||
{
|
||||
entity oldself = self;
|
||||
|
@ -849,5 +861,6 @@ NSProjectile_SpawnDefAttachment(string entityDef, NSEntity theOwner, int attachm
|
|||
EntityDef_SpawnClassname(entityDef);
|
||||
self = oldself;
|
||||
rocket.Launch(attachmentPos, theOwner.GetAngles(), 0.0f, 0.0f, 0.0f);
|
||||
return rocket;
|
||||
}
|
||||
#endif
|
Loading…
Reference in a new issue