- a few more.

This commit is contained in:
Christoph Oelckers 2019-01-27 16:59:50 +01:00
parent ae544fa21f
commit 522cc855ad
7 changed files with 18 additions and 20 deletions

View file

@ -693,7 +693,7 @@ bool player_t::Resurrect()
// fire E_PlayerRespawned and start the ACS SCRIPT_Respawn.
E_PlayerRespawned(int(this - players));
//
level.Behaviors.StartTypedScripts(SCRIPT_Respawn, mo, true);
mo->Level->Behaviors.StartTypedScripts(SCRIPT_Respawn, mo, true);
return true;
}
@ -890,7 +890,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PlayerScream)
}
// Handle the different player death screams
if ((((level.flags >> 15) | (dmflags)) &
if ((((self->Level->flags >> 15) | (dmflags)) &
(DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX)) &&
self->Vel.Z <= -39)
{
@ -1009,7 +1009,7 @@ void P_FallingDamage (AActor *actor)
int damage;
double vel;
damagestyle = ((level.flags >> 15) | (dmflags)) &
damagestyle = ((actor->Level->flags >> 15) | (dmflags)) &
(DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX);
if (damagestyle == 0)
@ -1110,7 +1110,7 @@ void P_CheckMusicChange(player_t *player)
{
if (player->MUSINFOactor->args[0] != 0)
{
FName *music = level.info->MusicMap.CheckKey(player->MUSINFOactor->args[0]);
FName *music = player->MUSINFOactor->Level->info->MusicMap.CheckKey(player->MUSINFOactor->args[0]);
if (music != NULL)
{
@ -1248,7 +1248,6 @@ void P_PredictionLerpReset()
bool P_LerpCalculate(AActor *pmo, PredictPos from, PredictPos to, PredictPos &result, float scale)
{
//DVector2 pfrom = level.Displacements.getOffset(from.portalgroup, to.portalgroup);
DVector3 vecFrom = from.pos;
DVector3 vecTo = to.pos;
DVector3 vecResult;
@ -1683,7 +1682,7 @@ bool P_IsPlayerTotallyFrozen(const player_t *player)
return
gamestate == GS_TITLELEVEL ||
player->cheats & CF_TOTALLYFROZEN ||
((level.flags2 & LEVEL2_FROZEN) && player->timefreezer == 0);
((player->mo->Level->flags2 & LEVEL2_FROZEN) && player->timefreezer == 0);
}

View file

@ -1035,7 +1035,7 @@ void FLevelLocals::CreateLinkedPortals()
if (linkedPortals.Size() > 0)
{
// We need to relink all actors that may touch a linked line portal
auto it = Level->GetThinkerIterator<AActor>();
auto it = GetThinkerIterator<AActor>();
AActor *actor;
while ((actor = it.Next()))
{

View file

@ -2136,11 +2136,11 @@ template<> FSerializer &Serialize(FSerializer &arc, const char *key, char *&pstr
//
// This is a bit of a cheat because it never actually writes out the pointer.
// The rules for levels are that they must be self-contained.
// No level and no pbject that is part of a level may reference a different level.
// No level and no pbject that is part of a level may reference a different one.
//
// When writing, this merely checks if the rules are obeyed and if not errors out.
// When reading, it assumes that the object was properly written and restores
// the reference from the owning level.
// the reference from the owning level
//
// The only exception are null pointers which are allowed
//
@ -2159,7 +2159,7 @@ template<> FSerializer &Serialize(FSerializer &arc, const char *key, FLevelLocal
}
else
{
// This MUST be the currently serialized level. Anything else will error out here as a sanity check.
// This MUST be the currently serialized level, anything else will error out here as a sanity check.
if (arc.Level == nullptr || lev != arc.Level)
{
I_Error("Attempt to serialize invalid level reference");

View file

@ -489,7 +489,7 @@ static bool Cht_ChangeStartSpot (cheatseq_t *cheat)
{
char cmd[64];
mysnprintf (cmd, countof(cmd), "changemap %s %c", level.MapName.GetChars(), cheat->Args[0]);
mysnprintf (cmd, countof(cmd), "changemap %s %c", currentUILevel->MapName.GetChars(), cheat->Args[0]);
C_DoCommand (cmd);
return true;
}

View file

@ -271,7 +271,6 @@ static int ParseStandardProperty(FScanner &scanner, UMapEntry *mape)
scanner.MustGetValue(false);
int tag = scanner.Number;
// allow no 0-tag specials here, unless a level exit.
#pragma message("Fixme: This needs to be evaluated at run time")
if (tag != 0 || special == 11 || special == 51 || special == 52 || special == 124)
{
// This cannot be evaluated here because this needs to be done in the context of the level being used.

View file

@ -93,6 +93,7 @@ void V_AddBlend (float r, float g, float b, float a, float v_blend[4])
void V_AddPlayerBlend (player_t *CPlayer, float blend[4], float maxinvalpha, int maxpainblend)
{
int cnt;
auto Level = CPlayer->mo->Level;
// [RH] All powerups can affect the screen blending now
for (AActor *item = CPlayer->mo->Inventory; item != NULL; item = item->Inventory)
@ -175,18 +176,18 @@ void V_AddPlayerBlend (player_t *CPlayer, float blend[4], float maxinvalpha, int
{
if (CPlayer->hazardcount > 16*TICRATE || (CPlayer->hazardcount & 8))
{
float r = ((level.hazardflash & 0xff0000) >> 16) / 255.f;
float g = ((level.hazardflash & 0xff00) >> 8) / 255.f;
float b = ((level.hazardflash & 0xff)) / 255.f;
float r = ((Level->hazardflash & 0xff0000) >> 16) / 255.f;
float g = ((Level->hazardflash & 0xff00) >> 8) / 255.f;
float b = ((Level->hazardflash & 0xff)) / 255.f;
V_AddBlend (r, g, b, 0.125f, blend);
}
}
else
{
cnt= MIN(CPlayer->hazardcount/8, 64);
float r = ((level.hazardcolor & 0xff0000) >> 16) / 255.f;
float g = ((level.hazardcolor & 0xff00) >> 8) / 255.f;
float b = ((level.hazardcolor & 0xff)) / 255.f;
float r = ((Level->hazardcolor & 0xff0000) >> 16) / 255.f;
float g = ((Level->hazardcolor & 0xff00) >> 8) / 255.f;
float b = ((Level->hazardcolor & 0xff)) / 255.f;
V_AddBlend (r, g, b, cnt/93.2571428571f, blend);
}
}

View file

@ -79,8 +79,7 @@ CUSTOM_CVAR (Float, Gamma, 1.f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CCMD (bumpgamma)
{
// [RH] Gamma correction tables are now generated
// on the fly for *any* gamma level.
// [RH] Gamma correction tables are now generated on the fly for *any* gamma level
// Q: What are reasonable limits to use here?
float newgamma = Gamma + 0.1f;