Merge commit '125afcf3de' into scripting
Conflicts: src/p_local.h src/p_mobj.cpp src/thingdef/thingdef_codeptr.cpp wadsrc/static/actors/shared/inventory.txt
This commit is contained in:
commit
5207aa6cc0
51 changed files with 2596 additions and 2131 deletions
|
|
@ -75,6 +75,7 @@
|
|||
#include "actorptrselect.h"
|
||||
#include "farchive.h"
|
||||
#include "decallib.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "g_shared/a_pickups.h"
|
||||
|
||||
|
|
@ -1417,7 +1418,7 @@ FBehavior *FBehavior::StaticLoadModule (int lumpnum, FileReader *fr, int len)
|
|||
else
|
||||
{
|
||||
delete behavior;
|
||||
Printf(TEXTCOLOR_RED "%s: invalid ACS module", Wads.GetLumpFullName(lumpnum));
|
||||
Printf(TEXTCOLOR_RED "%s: invalid ACS module\n", Wads.GetLumpFullName(lumpnum));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -5854,6 +5855,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
int flags = args[5];
|
||||
const char *statename = argCount > 6 ? FBehavior::StaticLookupString(args[6]) : "";
|
||||
bool exact = argCount > 7 ? !!args[7] : false;
|
||||
fixed_t heightoffset = argCount > 8 ? args[8] : 0;
|
||||
|
||||
FState *state = argCount > 6 ? activator->GetClass()->FindStateByString(statename, exact) : 0;
|
||||
|
||||
|
|
@ -5871,7 +5873,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
if (!reference)
|
||||
return false;
|
||||
|
||||
if (P_Thing_Warp(activator, reference, xofs, yofs, zofs, angle, flags))
|
||||
if (P_Thing_Warp(activator, reference, xofs, yofs, zofs, angle, flags, heightoffset))
|
||||
{
|
||||
if (state && argCount > 6)
|
||||
{
|
||||
|
|
@ -6023,6 +6025,7 @@ int DLevelScript::RunScript ()
|
|||
int sp = 0;
|
||||
int *pc = this->pc;
|
||||
ACSFormat fmt = activeBehavior->GetFormat();
|
||||
FBehavior* const savedActiveBehavior = activeBehavior;
|
||||
unsigned int runaway = 0; // used to prevent infinite loops
|
||||
int pcd;
|
||||
FString work;
|
||||
|
|
@ -6056,6 +6059,7 @@ int DLevelScript::RunScript ()
|
|||
{
|
||||
default:
|
||||
Printf ("Unknown P-Code %d in %s\n", pcd, ScriptPresentation(script).GetChars());
|
||||
activeBehavior = savedActiveBehavior;
|
||||
// fall through
|
||||
case PCD_TERMINATE:
|
||||
DPrintf ("%s finished\n", ScriptPresentation(script).GetChars());
|
||||
|
|
@ -7262,9 +7266,9 @@ int DLevelScript::RunScript ()
|
|||
sp--;
|
||||
break;
|
||||
|
||||
case PCD_DROP:
|
||||
case PCD_SETRESULTVALUE:
|
||||
resultValue = STACK(1);
|
||||
case PCD_DROP: //fall through.
|
||||
sp--;
|
||||
break;
|
||||
|
||||
|
|
@ -8871,7 +8875,22 @@ scriptwait:
|
|||
break;
|
||||
|
||||
case PCD_STRLEN:
|
||||
STACK(1) = SDWORD(strlen(FBehavior::StaticLookupString (STACK(1))));
|
||||
{
|
||||
const char *str = FBehavior::StaticLookupString(STACK(1));
|
||||
if (str != NULL)
|
||||
{
|
||||
STACK(1) = SDWORD(strlen(str));
|
||||
break;
|
||||
}
|
||||
|
||||
static bool StrlenInvalidPrintedAlready = false;
|
||||
if (!StrlenInvalidPrintedAlready)
|
||||
{
|
||||
Printf(PRINT_BOLD, "Warning: ACS function strlen called with invalid string argument.\n");
|
||||
StrlenInvalidPrintedAlready = true;
|
||||
}
|
||||
STACK(1) = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case PCD_GETCVAR:
|
||||
|
|
@ -9331,6 +9350,10 @@ scriptwait:
|
|||
}
|
||||
break;
|
||||
|
||||
case PCD_CONSOLECOMMAND:
|
||||
Printf (TEXTCOLOR_RED GAMENAME " doesn't support execution of console commands from scripts\n");
|
||||
sp -= 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue