From 27074e926ac6ec7759bb502b2b2f1dacf844907a Mon Sep 17 00:00:00 2001 From: def Date: Fri, 2 Jun 2017 19:44:01 +0200 Subject: [PATCH] Further cleanup --- src/engine/shared/snapshot.h | 1 - src/engine/shared/uuid_manager.cpp | 4 ++-- src/game/client/components/binds.cpp | 2 +- src/game/server/gamemodes/DDRace.cpp | 16 +++++++--------- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/engine/shared/snapshot.h b/src/engine/shared/snapshot.h index c7165eadf..eb85c4c9f 100644 --- a/src/engine/shared/snapshot.h +++ b/src/engine/shared/snapshot.h @@ -128,7 +128,6 @@ class CSnapshotBuilder int m_NumItems; int m_aExtendedItemTypes[MAX_EXTENDED_ITEM_TYPES]; - bool m_aExtendedItemTypesAdded[MAX_EXTENDED_ITEM_TYPES]; int m_NumExtendedItemTypes; void AddExtendedItemType(int Index); diff --git a/src/engine/shared/uuid_manager.cpp b/src/engine/shared/uuid_manager.cpp index d8ac24c07..3a8805e75 100644 --- a/src/engine/shared/uuid_manager.cpp +++ b/src/engine/shared/uuid_manager.cpp @@ -5,11 +5,11 @@ #include -static const CUuid TEEWORLDS_NAMESPACE = { +static const CUuid TEEWORLDS_NAMESPACE = {{ // "e05ddaaa-c4e6-4cfb-b642-5d48e80c0029" 0xe0, 0x5d, 0xda, 0xaa, 0xc4, 0xe6, 0x4c, 0xfb, 0xb6, 0x42, 0x5d, 0x48, 0xe8, 0x0c, 0x00, 0x29 -}; +}}; CUuid CalculateUuid(const char *pName) { diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index e76124849..e2fda6987 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -83,7 +83,7 @@ void CBinds::UnbindAll() { for(int i = 0; i < KEY_LAST; i++) { - if(m_apKeyBindings) + if(m_apKeyBindings[i]) mem_free(m_apKeyBindings[i]); m_apKeyBindings[i] = 0; } diff --git a/src/game/server/gamemodes/DDRace.cpp b/src/game/server/gamemodes/DDRace.cpp index 5db8356c1..f0476e752 100644 --- a/src/game/server/gamemodes/DDRace.cpp +++ b/src/game/server/gamemodes/DDRace.cpp @@ -36,20 +36,18 @@ void CGameControllerDDRace::InitTeleporter() for (int i = 0; i < Width * Height; i++) { - if (GameServer()->Collision()->TeleLayer()[i].m_Number > 0) + int Number = GameServer()->Collision()->TeleLayer()[i].m_Number; + int Type = GameServer()->Collision()->TeleLayer()[i].m_Type; + if (Number > 0) { - if (GameServer()->Collision()->TeleLayer()[i].m_Type - == TILE_TELEOUT) + if (Type == TILE_TELEOUT) { - m_TeleOuts[GameServer()->Collision()->TeleLayer()[i].m_Number - - 1].push_back( + m_TeleOuts[Number - 1].push_back( vec2(i % Width * 32 + 16, i / Width * 32 + 16)); } - else if (GameServer()->Collision()->TeleLayer()[i].m_Type - == TILE_TELECHECKOUT) + else if (Type == TILE_TELECHECKOUT) { - m_TeleCheckOuts[GameServer()->Collision()->TeleLayer()[i].m_Number - - 1].push_back( + m_TeleCheckOuts[Number - 1].push_back( vec2(i % Width * 32 + 16, i / Width * 32 + 16)); } }