Make linedef type 461 able to set object angle, using the line's angle.

This commit is contained in:
sphere 2020-04-13 17:10:25 +02:00
parent d460e1e826
commit 01b28b66a6
2 changed files with 6 additions and 1 deletions

View file

@ -15,7 +15,7 @@
* Oogaland * Oogaland
* Rob * Rob
* Shadow Hog * Shadow Hog
* Spherallic * sphere
* SRB2-Playah * SRB2-Playah
* SSNTails * SSNTails
* SteelT * SteelT
@ -2214,6 +2214,7 @@ linedeftypes
title = "Spawn Object"; title = "Spawn Object";
prefix = "(461)"; prefix = "(461)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags32text = "[5] Use line angle for object";
flags64text = "[6] Spawn inside a range"; flags64text = "[6] Spawn inside a range";
} }

View file

@ -4027,7 +4027,11 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
mobj = P_SpawnMobj(x, y, z, type); mobj = P_SpawnMobj(x, y, z, type);
if (mobj) if (mobj)
{
if (line->flags & ML_EFFECT1)
mobj->angle = R_PointToAngle2(line->v1->x, line->v1->y, line->v2->x, line->v2->y);
CONS_Debug(DBG_GAMELOGIC, "Linedef Type %d - Spawn Object: %d spawned at (%d, %d, %d)\n", line->special, mobj->type, mobj->x>>FRACBITS, mobj->y>>FRACBITS, mobj->z>>FRACBITS); //TODO: Convert mobj->type to a string somehow. CONS_Debug(DBG_GAMELOGIC, "Linedef Type %d - Spawn Object: %d spawned at (%d, %d, %d)\n", line->special, mobj->type, mobj->x>>FRACBITS, mobj->y>>FRACBITS, mobj->z>>FRACBITS); //TODO: Convert mobj->type to a string somehow.
}
else else
CONS_Alert(CONS_ERROR,"Linedef Type %d - Spawn Object: Object did not spawn!\n", line->special); CONS_Alert(CONS_ERROR,"Linedef Type %d - Spawn Object: Object did not spawn!\n", line->special);
} }