Merge remote-tracking branch 'origin/master' into newtimercode4

This commit is contained in:
Rachael Alexanderson 2017-11-15 22:33:27 -05:00
commit e867d75712
5 changed files with 48 additions and 6 deletions

View file

@ -129,7 +129,7 @@ int starttime;
extern FString BackupSaveName;
bool savegamerestore;
int finishstate;
int finishstate = FINISH_NoHub;
extern int mousex, mousey;
extern bool sendpause, sendsave, sendturn180, SendLand;
@ -852,6 +852,8 @@ void G_DoCompleted (void)
level.maptime = 0;
}
finishstate = mode;
if (!deathmatch &&
((level.flags & LEVEL_NOINTERMISSION) ||
((nextcluster == thiscluster) && (thiscluster->flags & CLUSTER_HUB) && !(thiscluster->flags & CLUSTER_ALLOWINTERMISSION))))
@ -861,7 +863,6 @@ void G_DoCompleted (void)
}
gamestate = GS_INTERMISSION;
finishstate = mode;
viewactive = false;
automapactive = false;
@ -1039,12 +1040,20 @@ void G_DoLoadLevel (int position, bool autosave)
{
players[ii].camera = players[ii].mo;
}
if (!savegamerestore)
if (savegamerestore)
{
E_PlayerEntered(ii, finishstate == FINISH_SameHub);
continue;
}
const bool fromSnapshot = level.FromSnapshot;
E_PlayerEntered(ii, fromSnapshot && finishstate == FINISH_SameHub);
if (fromSnapshot)
{
// ENTER scripts are being handled when the player gets spawned, this cannot be changed due to its effect on voodoo dolls.
if (level.FromSnapshot && !savegamerestore) FBehavior::StaticStartTypedScripts(SCRIPT_Return, players[ii].mo, true);
FBehavior::StaticStartTypedScripts(SCRIPT_Return, players[ii].mo, true);
}
}
}

View file

@ -945,3 +945,25 @@ int P_Thing_Warp(AActor *caller, AActor *reference, double xofs, double yofs, do
caller->SetOrigin(old, true);
return false;
}
//==========================================================================
//
// A_Warp
//
//==========================================================================
DEFINE_ACTION_FUNCTION(AActor, Warp)
{
PARAM_SELF_PROLOGUE(AActor)
PARAM_OBJECT_DEF(destination, AActor)
PARAM_FLOAT_DEF(xofs)
PARAM_FLOAT_DEF(yofs)
PARAM_FLOAT_DEF(zofs)
PARAM_ANGLE_DEF(angle)
PARAM_INT_DEF(flags)
PARAM_FLOAT_DEF(heightoffset)
PARAM_FLOAT_DEF(radiusoffset)
PARAM_ANGLE_DEF(pitch)
ACTION_RETURN_INT(!!P_Thing_Warp(self, destination, xofs, yofs, zofs, angle, flags, heightoffset, radiusoffset, pitch));
}

View file

@ -1225,6 +1225,15 @@ DEFINE_ACTION_FUNCTION(FStringStruct, Truncate)
return 0;
}
DEFINE_ACTION_FUNCTION(FStringStruct, Remove)
{
PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_UINT(index);
PARAM_UINT(remlen);
self->Remove(index, remlen);
return 0;
}
// CharAt and CharCodeAt is how JS does it, and JS is similar here in that it doesn't have char type as int.
DEFINE_ACTION_FUNCTION(FStringStruct, CharAt)
{

View file

@ -683,6 +683,7 @@ class Actor : Thinker native
native float AccuracyFactor();
native bool MorphMonster (Class<Actor> spawntype, int duration, int style, Class<Actor> enter_flash, Class<Actor> exit_flash);
action native void SetCamera(Actor cam, bool revert = false);
native bool Warp(Actor dest, double xofs = 0, double yofs = 0, double zofs = 0, double angle = 0, int flags = 0, double heightoffset = 0, double radiusoffset = 0, double pitch = 0);
// DECORATE compatible functions
native clearscope int CountInv(class<Inventory> itemtype, int ptr_select = AAPTR_DEFAULT) const;

View file

@ -684,6 +684,7 @@ struct StringStruct native
native String Left(int len) const;
native String Mid(int pos = 0, int len = 2147483647) const;
native void Truncate(int newlen);
native void Remove(int index, int remlen);
native String CharAt(int pos) const;
native int CharCodeAt(int pos) const;
native String Filter();