diff --git a/src/game/shared/weapons/genericitem.cpp b/src/game/shared/weapons/genericitem.cpp index afad150..a553f2b 100644 --- a/src/game/shared/weapons/genericitem.cpp +++ b/src/game/shared/weapons/genericitem.cpp @@ -443,7 +443,7 @@ void CGenericItemMgr::GenericItemPrecache(void) dbg("Load global items"); //GetString(cString, min(FileSize, sizeof(cString)), (char *)pStringPtr, i, "\r\n") - while (GetString(cString, V_min(FileSize, sizeof(cString)), (char*)pStringPtr, i, "\r\n")) + while (GetString(cString, V_min(FileSize, sizeof(cString)), (const char*)pStringPtr, i, "\r\n")) { n = i; i += strlen(cString) + 1; @@ -570,19 +570,19 @@ void CGenericItem::Deactivate() Container_Deactivate(); - if (DrinkData) + if (DrinkData != nullptr) { delete DrinkData; DrinkData = nullptr; } - if (ArmorData) + if (ArmorData != nullptr) { delete ArmorData; ArmorData = nullptr; } - if (ProjectileData) + if (ProjectileData != nullptr) { delete ProjectileData; ProjectileData = nullptr; diff --git a/src/game/shared/weapons/genericitem.h b/src/game/shared/weapons/genericitem.h index 0c1deba..b4fdee4 100644 --- a/src/game/shared/weapons/genericitem.h +++ b/src/game/shared/weapons/genericitem.h @@ -182,12 +182,12 @@ class CGenericItem : public CBasePlayerItem long lProperties; //Properties held over a frame, like JUSTSPAWNED char m_Name[64]; //Only for debugging... so I can see the item's name mslist m_Attacks; //Actions (mostly attacks) that the owner can activate with this item - attackdata_t *CurrentAttack; - struct packdata_t *PackData; - struct drinkdata_t *DrinkData; - struct armordata_t *ArmorData; - struct projectiledata_t *ProjectileData; - struct spelldata_t *SpellData; + attackdata_t *CurrentAttack = nullptr; + struct packdata_t *PackData = nullptr; + struct drinkdata_t *DrinkData = nullptr; + struct armordata_t *ArmorData = nullptr; + struct projectiledata_t *ProjectileData = nullptr; + struct spelldata_t *SpellData = nullptr; int m_Location, //Location of the item on the monster (Hands, back, etc) m_Hand; //The hand I'm in... if I'm in a hand