mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 04:22:34 +00:00
- added a GetCVarString ZScript/DECORATE function.
- fixed: loading a savegame triggered PlayerEntered events.
This commit is contained in:
parent
99d1581c27
commit
6870efe134
3 changed files with 35 additions and 1 deletions
|
@ -1028,7 +1028,10 @@ void G_DoLoadLevel (int position, bool autosave)
|
|||
{
|
||||
players[ii].camera = players[ii].mo;
|
||||
}
|
||||
E_PlayerEntered(ii, finishstate == FINISH_SameHub);
|
||||
if (!savegamerestore)
|
||||
{
|
||||
E_PlayerEntered(ii, finishstate == FINISH_SameHub);
|
||||
}
|
||||
// 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);
|
||||
}
|
||||
|
|
|
@ -654,6 +654,36 @@ DEFINE_ACTION_FUNCTION(AActor, GetCVar)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// GetCVar
|
||||
//
|
||||
// NON-ACTION function that works like ACS's GetCVar.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, GetCVarString)
|
||||
{
|
||||
if (numret > 0)
|
||||
{
|
||||
assert(ret != nullptr);
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_STRING(cvarname);
|
||||
|
||||
FBaseCVar *cvar = GetCVar(self, cvarname);
|
||||
if (cvar == nullptr)
|
||||
{
|
||||
ret->SetString("");
|
||||
}
|
||||
else
|
||||
{
|
||||
ret->SetString(cvar->GetGenericRep(CVAR_String).String);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// GetPlayerInput
|
||||
|
|
|
@ -671,6 +671,7 @@ class Actor : Thinker native
|
|||
native clearscope int GetSpawnHealth() const;
|
||||
native double GetCrouchFactor(int ptr = AAPTR_PLAYER1);
|
||||
native double GetCVar(string cvar);
|
||||
native double GetCVarString(string cvar);
|
||||
native int GetPlayerInput(int inputnum, int ptr = AAPTR_DEFAULT);
|
||||
native int CountProximity(class<Actor> classname, double distance, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||
native double GetSpriteAngle(int ptr = AAPTR_DEFAULT);
|
||||
|
|
Loading…
Reference in a new issue