diff options
| author | Shauren <shauren.trinity@gmail.com> | 2012-12-31 20:43:14 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2012-12-31 20:43:14 +0100 |
| commit | f1170ba0fb00c32d55bc7db0c0a2bae2aef2ec82 (patch) | |
| tree | 30449c7ad27c0c4c064adbf91404964ccba2eed5 /src/server/game/Entities | |
| parent | b229f72bf44e5d4a8abb02efe454348670122271 (diff) | |
Core: Fixed some level 4 warnings (msvc)
Diffstat (limited to 'src/server/game/Entities')
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.h | 42 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.h | 14 | ||||
| -rw-r--r-- | src/server/game/Entities/Item/ItemPrototype.h | 15 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 4 |
5 files changed, 35 insertions, 46 deletions
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 8a697dd0ef0..0ec31e3a161 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -64,13 +64,6 @@ enum CreatureFlagsExtra CREATURE_FLAG_EXTRA_NO_SKILLGAIN | CREATURE_FLAG_EXTRA_TAUNT_DIMINISH | CREATURE_FLAG_EXTRA_ALL_DIMINISH | \ CREATURE_FLAG_EXTRA_GUARD) -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform -#if defined(__GNUC__) -#pragma pack(1) -#else -#pragma pack(push, 1) -#endif - #define MAX_KILL_CREDIT 2 #define CREATURE_REGEN_INTERVAL 2 * IN_MILLISECONDS @@ -180,6 +173,13 @@ typedef UNORDERED_MAP<uint32, CreatureTemplate> CreatureTemplateContainer; // TODO: Add MAX_EXPANSION constant. #define MAX_CREATURE_BASE_HP 3 +// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform +#if defined(__GNUC__) +#pragma pack(1) +#else +#pragma pack(push, 1) +#endif + // Defines base stats for creatures (used to calculate HP/mana/armor). struct CreatureBaseStats { @@ -241,7 +241,7 @@ typedef UNORDERED_MAP<uint16, EquipmentInfo> EquipmentInfoContainer; // from `creature` table struct CreatureData { - explicit CreatureData() : dbData(true) {} + CreatureData() : dbData(true) {} uint32 id; // entry in creature_template uint16 mapid; uint16 phaseMask; @@ -264,19 +264,6 @@ struct CreatureData bool dbData; }; -// `creature_addon` table -struct CreatureAddon -{ - uint32 path_id; - uint32 mount; - uint32 bytes1; - uint32 bytes2; - uint32 emote; - std::vector<uint32> auras; -}; - -typedef UNORDERED_MAP<uint32, CreatureAddon> CreatureAddonContainer; - struct CreatureModelInfo { float bounding_radius; @@ -316,6 +303,19 @@ enum ChatType #pragma pack(pop) #endif +// `creature_addon` table +struct CreatureAddon +{ + uint32 path_id; + uint32 mount; + uint32 bytes1; + uint32 bytes2; + uint32 emote; + std::vector<uint32> auras; +}; + +typedef UNORDERED_MAP<uint32, CreatureAddon> CreatureAddonContainer; + // Vendors struct VendorItem { diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 32d73579f51..d4e2c7c7f2d 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -28,13 +28,6 @@ class GameObjectAI; -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform -#if defined(__GNUC__) -#pragma pack(1) -#else -#pragma pack(push, 1) -#endif - #define MAX_GAMEOBJECT_QUEST_ITEMS 6 // from `gameobject_template` @@ -549,13 +542,6 @@ union GameObjectValue } Building; }; -// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform -#if defined(__GNUC__) -#pragma pack() -#else -#pragma pack(pop) -#endif - struct GameObjectLocale { StringVector Name; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index f2f41d6a8b9..aaa55141244 100644 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -578,6 +578,13 @@ struct _Socket uint32 Content; }; +// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform +#if defined(__GNUC__) +#pragma pack() +#else +#pragma pack(pop) +#endif + #define MAX_ITEM_PROTO_DAMAGES 2 // changed in 3.1.0 #define MAX_ITEM_PROTO_SOCKETS 3 #define MAX_ITEM_PROTO_SPELLS 5 @@ -589,7 +596,7 @@ struct ItemTemplate uint32 Class; // id from ItemClass.dbc uint32 SubClass; // id from ItemSubClass.dbc int32 SoundOverrideSubclass; // < 0: id from ItemSubClass.dbc, used to override weapon sound from actual SubClass - std::string Name1; + std::string Name1; uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc uint32 Quality; uint32 Flags; @@ -761,10 +768,4 @@ struct ItemSetNameLocale StringVector Name; }; -// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform -#if defined(__GNUC__) -#pragma pack() -#else -#pragma pack(pop) -#endif #endif diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 705360ec32a..27b9f33cccc 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2380,6 +2380,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float sLog->outError(LOG_FILTER_SQL, "Gameobject template %u not found in database!", entry); return NULL; } + Map* map = GetMap(); GameObject* go = new GameObject(); if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY)) @@ -2387,13 +2388,14 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float delete go; return NULL; } + go->SetRespawnTime(respawnTime); if (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT) //not sure how to handle this - ((Unit*)this)->AddGameObject(go); + ToUnit()->AddGameObject(go); else go->SetSpawnedByDefault(false); - map->AddToMap(go); + map->AddToMap(go); return go; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3d22d1b4ed6..5085062b98c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17068,8 +17068,8 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) else // This can happen during Player::_LoadAuras { int32 bp0[MAX_SPELL_EFFECTS]; - for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) - bp0[i] = spellEntry->Effects[i].BasePoints; + for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j) + bp0[j] = spellEntry->Effects[j].BasePoints; bp0[i] = seatId; Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, bp0, NULL, origCasterGUID); |
