diff options
author | Shauren <shauren.trinity@gmail.com> | 2012-02-23 13:01:16 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2012-02-23 13:01:16 +0100 |
commit | dc28b924151374776aefa04935379ad095eb4c06 (patch) | |
tree | 011094e08fea11d09cc6643a8284702f43c948f6 /src/server/game/Scripting/MapScripts.cpp | |
parent | dbd8cbcfc4e5f89da98551db90e34a91ed339f3d (diff) |
Core: Random cleanup + compile fix
Diffstat (limited to 'src/server/game/Scripting/MapScripts.cpp')
-rwxr-xr-x | src/server/game/Scripting/MapScripts.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 7757e1a1a35..fb2590ebbfe 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -39,9 +39,9 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O return; // prepare static data - uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; //some script commands doesn't have source - uint64 targetGUID = target ? target->GetGUID() : (uint64)0; - uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0; + uint64 sourceGUID = source ? source->GetGUID() : uint64(0); //some script commands doesn't have source + uint64 targetGUID = target ? target->GetGUID() : uint64(0); + uint64 ownerGUID = (source && source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : uint64(0); ///- Schedule script execution for all scripts in the script map ScriptMap const* s2 = &(s->second); @@ -74,9 +74,9 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou // NOTE: script record _must_ exist until command executed // prepare static data - uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; - uint64 targetGUID = target ? target->GetGUID() : (uint64)0; - uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0; + uint64 sourceGUID = source ? source->GetGUID() : uint64(0); + uint64 targetGUID = target ? target->GetGUID() : uint64(0); + uint64 ownerGUID = (source && source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : uint64(0); ScriptAction sa; sa.sourceGUID = sourceGUID; |