aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-12-31 20:43:14 +0100
committerShauren <shauren.trinity@gmail.com>2012-12-31 20:43:14 +0100
commitf1170ba0fb00c32d55bc7db0c0a2bae2aef2ec82 (patch)
tree30449c7ad27c0c4c064adbf91404964ccba2eed5 /src/server/game
parentb229f72bf44e5d4a8abb02efe454348670122271 (diff)
Core: Fixed some level 4 warnings (msvc)
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp2
-rw-r--r--src/server/game/Entities/Creature/Creature.h42
-rw-r--r--src/server/game/Entities/GameObject/GameObject.h14
-rw-r--r--src/server/game/Entities/Item/ItemPrototype.h15
-rw-r--r--src/server/game/Entities/Object/Object.cpp6
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
-rw-r--r--src/server/game/Handlers/QueryHandler.cpp2
-rw-r--r--src/server/game/Loot/LootMgr.cpp4
-rw-r--r--src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp2
-rw-r--r--src/server/game/Movement/Spline/MovementPacketBuilder.cpp2
-rw-r--r--src/server/game/World/World.h4
11 files changed, 43 insertions, 54 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index f66783fb89a..9e05536a1dd 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -170,7 +170,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
condMeets = instance->GetData64(ConditionValue1) == ConditionValue2;
break;
case INSTANCE_INFO_BOSS_STATE:
- condMeets = instance->GetBossState(ConditionValue1) == ConditionValue2;
+ condMeets = instance->GetBossState(ConditionValue1) == EncounterState(ConditionValue2);
break;
}
}
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);
diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp
index e44fbd0d899..b1251b8631c 100644
--- a/src/server/game/Handlers/QueryHandler.cpp
+++ b/src/server/game/Handlers/QueryHandler.cpp
@@ -189,7 +189,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recvData)
data << IconName; // 2.0.3, string. Icon name to use instead of default icon for go's (ex: "Attack" makes sword)
data << CastBarCaption; // 2.0.3, string. Text will appear in Cast Bar when using GO (ex: "Collecting")
data << info->unk1; // 2.0.3, string
- data.append(info->raw.data, 24);
+ data.append(info->raw.data, MAX_GAMEOBJECT_DATA);
data << float(info->size); // go size
for (uint32 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i)
data << uint32(info->questItems[i]); // itemId[6], quest drop
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 098fcc657b3..f4313553e56 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -666,7 +666,7 @@ void Loot::DeleteLootItemFromContainerItemDB(uint32 itemID)
// Mark the item looted to prevent resaving
for (LootItemList::iterator _itr = items.begin(); _itr != items.end(); _itr++)
{
- if (!_itr->itemid == itemID)
+ if (_itr->itemid != itemID)
continue;
_itr->canSave = true;
@@ -1272,7 +1272,7 @@ void LootTemplate::CopyConditions(LootItem* li) const
// Copies the conditions list from a template item to a LootItem
for (LootStoreItemList::const_iterator _iter = Entries.begin(); _iter != Entries.end(); ++_iter)
{
- if (!_iter->itemid == li->itemid)
+ if (_iter->itemid != li->itemid)
continue;
li->conditions = _iter->conditions;
diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
index 1e9ea3156d8..ffcc83e61ea 100644
--- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
@@ -50,7 +50,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
init.Launch();
arrived = false;
- owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE);
+ owner.ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE));
}
bool HomeMovementGenerator<Creature>::DoUpdate(Creature &owner, const uint32 /*time_diff*/)
diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
index 8aef671d2d1..d747d6f69a6 100644
--- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
+++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
@@ -70,7 +70,7 @@ namespace Movement
// add fake Enter_Cycle flag - needed for client-side cyclic movement (client will erase first spline vertex after first cycle done)
splineflags.enter_cycle = move_spline.isCyclic();
- data << uint32(splineflags & ~MoveSplineFlag::Mask_No_Monster_Move);
+ data << uint32(splineflags & uint32(~MoveSplineFlag::Mask_No_Monster_Move));
if (splineflags.animation)
{
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index c541945a1e4..5691add1d87 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -606,8 +606,8 @@ class World
/// Get the maximum skill level a player can reach
uint16 GetConfigMaxSkillValue() const
{
- uint8 lvl = getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
- return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl*5;
+ uint16 lvl = uint16(getIntConfig(CONFIG_MAX_PLAYER_LEVEL));
+ return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl * 5;
}
void SetInitialWorldSettings();