- Fixed: Hexen's ACS implementation truncates all line specials to bytes, so we need to do the

same for maps defined with Hexen-style MAPINFOs.

SVN r3336 (trunk)
This commit is contained in:
Randy Heit 2012-01-21 23:47:13 +00:00
parent 243197bfd4
commit 83fc6cf53a
2 changed files with 54 additions and 29 deletions

View file

@ -3676,6 +3676,9 @@ int DLevelScript::RunScript ()
FRemapTable *translation = 0;
int resultValue = 1;
// Hexen truncates all special arguments to bytes.
const int specialargmask = (level.flags2 & LEVEL2_HEXENHACK) ? 255 : ~0;
switch (state)
{
case SCRIPT_Delayed:
@ -3845,78 +3848,100 @@ int DLevelScript::RunScript ()
case PCD_LSPEC1:
P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(1), 0, 0, 0, 0);
STACK(1) & specialargmask, 0, 0, 0, 0);
sp -= 1;
break;
case PCD_LSPEC2:
P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(2), STACK(1), 0, 0, 0);
STACK(2) & specialargmask,
STACK(1) & specialargmask, 0, 0, 0);
sp -= 2;
break;
case PCD_LSPEC3:
P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(3), STACK(2), STACK(1), 0, 0);
STACK(3) & specialargmask,
STACK(2) & specialargmask,
STACK(1) & specialargmask, 0, 0);
sp -= 3;
break;
case PCD_LSPEC4:
P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(4), STACK(3), STACK(2),
STACK(1), 0);
STACK(4) & specialargmask,
STACK(3) & specialargmask,
STACK(2) & specialargmask,
STACK(1) & specialargmask, 0);
sp -= 4;
break;
case PCD_LSPEC5:
P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(5), STACK(4), STACK(3),
STACK(2), STACK(1));
STACK(5) & specialargmask,
STACK(4) & specialargmask,
STACK(3) & specialargmask,
STACK(2) & specialargmask,
STACK(1) & specialargmask);
sp -= 5;
break;
case PCD_LSPEC5RESULT:
STACK(5) = P_ExecuteSpecial(NEXTBYTE, activationline, activator, backSide,
STACK(5), STACK(4), STACK(3),
STACK(2), STACK(1));
STACK(5) & specialargmask,
STACK(4) & specialargmask,
STACK(3) & specialargmask,
STACK(2) & specialargmask,
STACK(1) & specialargmask);
sp -= 4;
break;
case PCD_LSPEC1DIRECT:
temp = NEXTBYTE;
P_ExecuteSpecial(temp, activationline, activator, backSide,
uallong(pc[0]), 0, 0, 0, 0);
uallong(pc[0]) & specialargmask ,0, 0, 0, 0);
pc += 1;
break;
case PCD_LSPEC2DIRECT:
temp = NEXTBYTE;
P_ExecuteSpecial(temp, activationline, activator, backSide,
uallong(pc[0]), uallong(pc[1]), 0, 0, 0);
uallong(pc[0]) & specialargmask,
uallong(pc[1]) & specialargmask, 0, 0, 0);
pc += 2;
break;
case PCD_LSPEC3DIRECT:
temp = NEXTBYTE;
P_ExecuteSpecial(temp, activationline, activator, backSide,
uallong(pc[0]), uallong(pc[1]), uallong(pc[2]), 0, 0);
uallong(pc[0]) & specialargmask,
uallong(pc[1]) & specialargmask,
uallong(pc[2]) & specialargmask, 0, 0);
pc += 3;
break;
case PCD_LSPEC4DIRECT:
temp = NEXTBYTE;
P_ExecuteSpecial(temp, activationline, activator, backSide,
uallong(pc[0]), uallong(pc[1]), uallong(pc[2]), uallong(pc[3]), 0);
uallong(pc[0]) & specialargmask,
uallong(pc[1]) & specialargmask,
uallong(pc[2]) & specialargmask,
uallong(pc[3]) & specialargmask, 0);
pc += 4;
break;
case PCD_LSPEC5DIRECT:
temp = NEXTBYTE;
P_ExecuteSpecial(temp, activationline, activator, backSide,
uallong(pc[0]), uallong(pc[1]), uallong(pc[2]), uallong(pc[3]), uallong(pc[4]));
uallong(pc[0]) & specialargmask,
uallong(pc[1]) & specialargmask,
uallong(pc[2]) & specialargmask,
uallong(pc[3]) & specialargmask,
uallong(pc[4]) & specialargmask);
pc += 5;
break;
// Parameters for PCD_LSPEC?DIRECTB are by definition bytes so never need and-ing.
case PCD_LSPEC1DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], 0, 0, 0, 0);

View file

@ -57,13 +57,13 @@
#include "gi.h"
#include "statnums.h"
#include "g_level.h"
#include "v_font.h"
#include "a_sharedglobal.h"
#include "farchive.h"
#include "a_keys.h"
// State.
#include "r_state.h"
#include "v_font.h"
#include "a_sharedglobal.h"
#include "farchive.h"
#include "a_keys.h"
// State.
#include "r_state.h"
#include "c_console.h"
@ -233,14 +233,14 @@ bool P_ActivateLine (line_t *line, AActor *mo, int side, int activationType)
BYTE special;
if (!P_TestActivateLine (line, mo, side, activationType))
{
return false;
}
int remote = (line->special != 7 && line->special != 8 && (line->special < 11 || line->special > 14));
if (line->locknumber > 0 && !P_CheckKeys (mo, line->locknumber, remote)) return false;
lineActivation = line->activation;
repeat = line->flags & ML_REPEAT_SPECIAL;
buttonSuccess = false;
{
return false;
}
int remote = (line->special != 7 && line->special != 8 && (line->special < 11 || line->special > 14));
if (line->locknumber > 0 && !P_CheckKeys (mo, line->locknumber, remote)) return false;
lineActivation = line->activation;
repeat = line->flags & ML_REPEAT_SPECIAL;
buttonSuccess = false;
buttonSuccess = P_ExecuteSpecial(line->special,
line, mo, side == 1, line->args[0],
line->args[1], line->args[2],