Introduce flag to render all entities

This commit is contained in:
Learath 2019-07-31 15:20:17 +03:00
parent a0e2abf4af
commit 6882db1da2
4 changed files with 10 additions and 7 deletions

View file

@ -17,7 +17,7 @@ GameInfoFlags = [
"BUG_DDRACE_INPUT", "BUG_FNG_LASER_RANGE", "BUG_VANILLA_BOUNCE", "BUG_DDRACE_INPUT", "BUG_FNG_LASER_RANGE", "BUG_VANILLA_BOUNCE",
"PREDICT_FNG", "PREDICT_DDRACE", "PREDICT_DDRACE_TILES", "PREDICT_VANILLA", "PREDICT_FNG", "PREDICT_DDRACE", "PREDICT_DDRACE_TILES", "PREDICT_VANILLA",
"ENTITIES_DDNET", "ENTITIES_DDRACE", "ENTITIES_RACE", "ENTITIES_FNG", "ENTITIES_DDNET", "ENTITIES_DDRACE", "ENTITIES_RACE", "ENTITIES_FNG",
"ENTITIES_VANILLA", "ENTITIES_VANILLA", "ENTITIES_UNUSED",
] ]
Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"] Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"]

View file

@ -620,21 +620,21 @@ void CMapLayers::OnMapLoad()
{ {
Index = ((CTile*)pTiles)[y*pTMap->m_Width+x].m_Index; Index = ((CTile*)pTiles)[y*pTMap->m_Width+x].m_Index;
Flags = ((CTile*)pTiles)[y*pTMap->m_Width+x].m_Flags; Flags = ((CTile*)pTiles)[y*pTMap->m_Width+x].m_Flags;
if(GameClient()->m_GameInfo.m_EntitiesDDNet && !IsValidGameTile(Index)) if(!GameClient()->m_GameInfo.m_EntitiesUnused && !IsValidGameTile(Index))
Index = 0; Index = 0;
} }
if(IsFrontLayer) if(IsFrontLayer)
{ {
Index = ((CTile*)pTiles)[y*pTMap->m_Width+x].m_Index; Index = ((CTile*)pTiles)[y*pTMap->m_Width+x].m_Index;
Flags = ((CTile*)pTiles)[y*pTMap->m_Width+x].m_Flags; Flags = ((CTile*)pTiles)[y*pTMap->m_Width+x].m_Flags;
if(GameClient()->m_GameInfo.m_EntitiesDDNet && !IsValidFrontTile(Index)) if(!GameClient()->m_GameInfo.m_EntitiesUnused && !IsValidFrontTile(Index))
Index = 0; Index = 0;
} }
if(IsSwitchLayer) if(IsSwitchLayer)
{ {
Flags = 0; Flags = 0;
Index = ((CSwitchTile*)pTiles)[y*pTMap->m_Width+x].m_Type; Index = ((CSwitchTile*)pTiles)[y*pTMap->m_Width+x].m_Type;
if(GameClient()->m_GameInfo.m_EntitiesDDNet && !IsValidSwitchTile(Index)) if(!GameClient()->m_GameInfo.m_EntitiesUnused && !IsValidSwitchTile(Index))
Index = 0; Index = 0;
else if(CurOverlay == 0) else if(CurOverlay == 0)
{ {
@ -650,7 +650,7 @@ void CMapLayers::OnMapLoad()
{ {
Index = ((CTeleTile*)pTiles)[y*pTMap->m_Width+x].m_Type; Index = ((CTeleTile*)pTiles)[y*pTMap->m_Width+x].m_Type;
Flags = 0; Flags = 0;
if(GameClient()->m_GameInfo.m_EntitiesDDNet && !IsValidTeleTile(Index)) if(!GameClient()->m_GameInfo.m_EntitiesUnused && !IsValidTeleTile(Index))
Index = 0; Index = 0;
else if(CurOverlay == 1) else if(CurOverlay == 1)
{ {
@ -664,7 +664,7 @@ void CMapLayers::OnMapLoad()
Index = ((CSpeedupTile*)pTiles)[y*pTMap->m_Width+x].m_Type; Index = ((CSpeedupTile*)pTiles)[y*pTMap->m_Width+x].m_Type;
Flags = 0; Flags = 0;
AngleRotate = ((CSpeedupTile*)pTiles)[y*pTMap->m_Width + x].m_Angle; AngleRotate = ((CSpeedupTile*)pTiles)[y*pTMap->m_Width + x].m_Angle;
if(GameClient()->m_GameInfo.m_EntitiesDDNet && (!IsValidSpeedupTile(Index) || ((CSpeedupTile*)pTiles)[y*pTMap->m_Width+x].m_Force == 0)) if(!GameClient()->m_GameInfo.m_EntitiesUnused && (!IsValidSpeedupTile(Index) || ((CSpeedupTile*)pTiles)[y*pTMap->m_Width+x].m_Force == 0))
Index = 0; Index = 0;
else if(CurOverlay == 1) else if(CurOverlay == 1)
Index = ((CSpeedupTile*)pTiles)[y*pTMap->m_Width+x].m_Force; Index = ((CSpeedupTile*)pTiles)[y*pTMap->m_Width+x].m_Force;
@ -674,7 +674,7 @@ void CMapLayers::OnMapLoad()
if(IsTuneLayer) if(IsTuneLayer)
{ {
Index = ((CTuneTile*)pTiles)[y*pTMap->m_Width+x].m_Type; Index = ((CTuneTile*)pTiles)[y*pTMap->m_Width+x].m_Type;
if(GameClient()->m_GameInfo.m_EntitiesDDNet && !IsValidTuneTile(Index)) if(!GameClient()->m_GameInfo.m_EntitiesUnused && !IsValidTuneTile(Index))
Index = 0; Index = 0;
Flags = 0; Flags = 0;
} }

View file

@ -1025,6 +1025,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize,
Info.m_EntitiesRace = Race; Info.m_EntitiesRace = Race;
Info.m_EntitiesFNG = FNG; Info.m_EntitiesFNG = FNG;
Info.m_EntitiesVanilla = Vanilla; Info.m_EntitiesVanilla = Vanilla;
Info.m_EntitiesUnused = !DDNet;
Info.m_Race = Race; Info.m_Race = Race;
if(Version >= 0) if(Version >= 0)
@ -1056,6 +1057,7 @@ static CGameInfo GetGameInfo(const CNetObj_GameInfoEx *pInfoEx, int InfoExSize,
} }
if(Version >= 3) if(Version >= 3)
{ {
Info.m_EntitiesUnused = Flags&GAMEINFOFLAG_ENTITIES_UNUSED;
Info.m_Race = Flags&GAMEINFOFLAG_RACE; Info.m_Race = Flags&GAMEINFOFLAG_RACE;
} }
return Info; return Info;

View file

@ -88,6 +88,7 @@ public:
bool m_EntitiesFNG; bool m_EntitiesFNG;
bool m_EntitiesVanilla; bool m_EntitiesVanilla;
bool m_EntitiesUnused;
bool m_Race; bool m_Race;
}; };