Add flag to invert current gravity to gravity flip executor

This commit is contained in:
spherallic 2022-09-07 23:11:02 +02:00
parent ef35084d95
commit f0adc71f9b
4 changed files with 18 additions and 4 deletions

View file

@ -2315,6 +2315,7 @@ linedeftypes
title = "Enable/Disable Gravity Flip"; title = "Enable/Disable Gravity Flip";
prefix = "(433)"; prefix = "(433)";
flags8text = "[3] Set delay by backside sector"; flags8text = "[3] Set delay by backside sector";
flags32text = "[5] Invert current gravity";
flags64text = "[6] Return to normal"; flags64text = "[6] Return to normal";
} }

View file

@ -4157,7 +4157,7 @@ udmf
prefix = "(433)"; prefix = "(433)";
arg0 arg0
{ {
title = "Gravity"; title = "Set gravity";
type = 11; type = 11;
enum enum
{ {
@ -4165,6 +4165,16 @@ udmf
1 = "Normal"; 1 = "Normal";
} }
} }
arg1
{
title = "Invert current gravity";
type = 11;
enum
{
0 = "No";
1 = "Yes";
}
}
} }
434 434

View file

@ -5164,6 +5164,7 @@ static void P_ConvertBinaryLinedefTypes(void)
break; break;
case 433: //Enable/disable gravity flip case 433: //Enable/disable gravity flip
lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB); lines[i].args[0] = !!(lines[i].flags & ML_NOCLIMB);
lines[i].args[1] = !!(lines[i].flags & ML_SKEWTD);
break; break;
case 434: //Award power-up case 434: //Award power-up
if (sides[lines[i].sidenum[0]].text) if (sides[lines[i].sidenum[0]].text)

View file

@ -2773,7 +2773,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
break; break;
case 433: // Flip/flop gravity. Works on pushables, too! case 433: // Flip/flop gravity. Works on pushables, too!
if (line->args[0]) if (line->args[1])
mo->flags2 ^= MF2_OBJECTFLIP;
else if (line->args[0])
mo->flags2 &= ~MF2_OBJECTFLIP; mo->flags2 &= ~MF2_OBJECTFLIP;
else else
mo->flags2 |= MF2_OBJECTFLIP; mo->flags2 |= MF2_OBJECTFLIP;