mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
- added a new argument to GlassBreak to allow it to spawn other types of debris than GlassJunk by passing a spawn ID.
This commit is contained in:
parent
8c30ca213d
commit
0514a997db
2 changed files with 26 additions and 13 deletions
|
@ -47,7 +47,7 @@ DEFINE_SPECIAL(Ceiling_CrushRaiseAndStay, 45, 3, 4, 4)
|
|||
DEFINE_SPECIAL(Floor_CrushStop, 46, 1, 1, 1)
|
||||
DEFINE_SPECIAL(Ceiling_MoveToValue, 47, 3, 5, 5)
|
||||
DEFINE_SPECIAL(Sector_Attach3dMidtex, 48, -1, -1, 3)
|
||||
DEFINE_SPECIAL(GlassBreak, 49, 0, 1, 1)
|
||||
DEFINE_SPECIAL(GlassBreak, 49, 0, 1, 2)
|
||||
DEFINE_SPECIAL(ExtraFloor_LightOnly, 50, -1, -1, 2)
|
||||
DEFINE_SPECIAL(Sector_SetLink, 51, 4, 4, 4)
|
||||
DEFINE_SPECIAL(Scroll_Wall, 52, 5, 5, 5)
|
||||
|
|
|
@ -3177,7 +3177,7 @@ FUNC(LS_ClearForceField)
|
|||
}
|
||||
|
||||
FUNC(LS_GlassBreak)
|
||||
// GlassBreak (bNoJunk)
|
||||
// GlassBreak (bNoJunk, junkID)
|
||||
{
|
||||
bool switched;
|
||||
bool quest1, quest2;
|
||||
|
@ -3197,7 +3197,6 @@ FUNC(LS_GlassBreak)
|
|||
{
|
||||
if (!arg0)
|
||||
{ // Break some glass
|
||||
AActor *glass;
|
||||
|
||||
DVector2 linemid((ln->v1->fX() + ln->v2->fX()) / 2, (ln->v1->fY() + ln->v2->fY()) / 2);
|
||||
|
||||
|
@ -3209,13 +3208,26 @@ FUNC(LS_GlassBreak)
|
|||
y += (ln->frontsector->centerspot.y - y) / 5;
|
||||
*/
|
||||
|
||||
auto type = SpawnableThings.CheckKey(arg1);
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
glass = Spawn("GlassJunk", DVector3(linemid, ONFLOORZ), ALLOW_REPLACE);
|
||||
|
||||
AActor *glass = nullptr;
|
||||
if (arg1 > 0)
|
||||
{
|
||||
if (type != nullptr)
|
||||
{
|
||||
glass = Spawn(*type, DVector3(linemid, ONFLOORZ), ALLOW_REPLACE);
|
||||
glass->AddZ(24.);
|
||||
glass->SetState (glass->SpawnState + (pr_glass() % glass->health));
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
glass = Spawn("GlassJunk", DVector3(linemid, ONFLOORZ), ALLOW_REPLACE);
|
||||
glass->AddZ(24.);
|
||||
glass->SetState(glass->SpawnState + (pr_glass() % glass->health));
|
||||
}
|
||||
if (glass != nullptr)
|
||||
{
|
||||
glass->Angles.Yaw = pr_glass() * (360 / 256.);
|
||||
glass->VelFromAngle(pr_glass() & 3);
|
||||
glass->Vel.Z = (pr_glass() & 7);
|
||||
|
@ -3223,6 +3235,7 @@ FUNC(LS_GlassBreak)
|
|||
glass->tics += pr_glass();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (quest1 || quest2)
|
||||
{ // Up stats and signal this mission is complete
|
||||
if (it == NULL)
|
||||
|
|
Loading…
Reference in a new issue