mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-17 01:31:25 +00:00
- changed infighting check so that the static skill checker does not access the level
Instead the level needs to be queried now.
This commit is contained in:
parent
d0942bcb97
commit
1dc11c5032
6 changed files with 16 additions and 7 deletions
|
@ -64,8 +64,6 @@ void G_PlayDemo (char* name);
|
|||
void G_TimeDemo (const char* name);
|
||||
bool G_CheckDemoStatus (void);
|
||||
|
||||
void G_WorldDone (void);
|
||||
|
||||
void G_Ticker (void);
|
||||
bool G_Responder (event_t* ev);
|
||||
|
||||
|
|
|
@ -2052,6 +2052,19 @@ void FLevelLocals::SetMusicVolume(float f)
|
|||
I_SetMusicVolume(f);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
int FLevelLocals::GetInfighting()
|
||||
{
|
||||
if (flags2 & LEVEL2_TOTALINFIGHTING) return 1;
|
||||
if (flags2 & LEVEL2_NOINFIGHTING) return -1;
|
||||
return G_SkillProperty(SKILLP_Infight);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
// IsPointInMap
|
||||
//
|
||||
|
|
|
@ -174,6 +174,7 @@ struct FLevelLocals : public FLevelData
|
|||
int GetConversation(FName classname);
|
||||
void SetConversation(int convid, PClassActor *Class, int dlgindex);
|
||||
int FindNode (const FStrifeDialogueNode *node);
|
||||
int GetInfighting();
|
||||
void Init();
|
||||
|
||||
private:
|
||||
|
|
|
@ -393,9 +393,6 @@ int G_SkillProperty(ESkillProperty prop)
|
|||
return AllSkills[gameskill].NoPain;
|
||||
|
||||
case SKILLP_Infight:
|
||||
// This property also needs to consider the level flags for the same info.
|
||||
if (level.flags2 & LEVEL2_TOTALINFIGHTING) return 1;
|
||||
if (level.flags2 & LEVEL2_NOINFIGHTING) return -1;
|
||||
if (AllSkills[gameskill].Infighting == LEVEL2_TOTALINFIGHTING) return 1;
|
||||
if (AllSkills[gameskill].Infighting == LEVEL2_NOINFIGHTING) return -1;
|
||||
return infighting;
|
||||
|
|
|
@ -1622,7 +1622,7 @@ bool AActor::OkayToSwitchTarget(AActor *other)
|
|||
int infight;
|
||||
if (flags7 & MF7_FORCEINFIGHTING) infight = 1;
|
||||
else if (flags5 & MF5_NOINFIGHTING) infight = -1;
|
||||
else infight = G_SkillProperty(SKILLP_Infight);
|
||||
else infight = Level->GetInfighting();
|
||||
|
||||
if (infight < 0 && other->player == NULL && !IsHostile (other))
|
||||
{
|
||||
|
|
|
@ -1163,7 +1163,7 @@ static bool CanAttackHurt(AActor *victim, AActor *shooter)
|
|||
// to harm / be harmed by anything.
|
||||
if (!victim->player && !shooter->player)
|
||||
{
|
||||
int infight = G_SkillProperty(SKILLP_Infight);
|
||||
int infight = victim->Level->GetInfighting();
|
||||
if (infight < 0 && (victim->flags7 & MF7_FORCEINFIGHTING)) infight = 0; // This must override the 'no infight' setting to take effect.
|
||||
|
||||
if (infight < 0)
|
||||
|
|
Loading…
Reference in a new issue