- added A_SprayDecal function.
This commit is contained in:
parent
c4b546404a
commit
5fe04dfd20
5 changed files with 30 additions and 19 deletions
|
|
@ -704,6 +704,24 @@ CCMD (spray)
|
|||
Net_WriteString (argv[1]);
|
||||
}
|
||||
|
||||
void SprayDecal(AActor *shooter, const char *name)
|
||||
{
|
||||
FTraceResults trace;
|
||||
|
||||
DAngle ang = shooter->Angles.Yaw;
|
||||
DAngle pitch = shooter->Angles.Pitch;
|
||||
double c = pitch.Cos();
|
||||
DVector3 vec(c * ang.Cos(), c * ang.Sin(), -pitch.Sin());
|
||||
|
||||
if (Trace(shooter->PosPlusZ(shooter->Height / 2), shooter->Sector, vec, 172., 0, ML_BLOCKEVERYTHING, shooter, trace, TRACE_NoSky))
|
||||
{
|
||||
if (trace.HitType == TRACE_HitWall)
|
||||
{
|
||||
DImpactDecal::StaticCreate(name, trace.HitPos, trace.Line->sidedef[trace.Side], NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DBaseDecal *ShootDecal(const FDecalTemplate *tpl, AActor *basisactor, sector_t *sec, double x, double y, double z, DAngle angle, double tracedist, bool permanent)
|
||||
{
|
||||
if (tpl == NULL || (tpl = tpl->GetDecal()) == NULL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue