Core/Entities: debloat SummonGameObject parameter list using proper wrappers and enable GO rotation in scripts
- There's still an overload allowing for x, y, z, o to be passed directly - Fixed default animstate for GameObject creation in many places, it should be 255, not 100 (checked in sniffs) (cherry picked from commit 62bfee37cb21584cef631dda428feaf5eb829cda) Conflicts: src/server/game/Entities/GameObject/GameObject.cpp src/server/game/Entities/Object/Object.cpp src/server/game/Spells/SpellEffects.cpp src/server/scripts/Commands/cs_gobject.cpp src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp src/server/scripts/Kalimdor/zone_feralas.cpp
This commit is contained in:
1 parent
8ff67eb6ac
commit
30d4f70533
37 files changed
+117
-135
No files matched your search
@@ -1242,18 +1242,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
if (targets)
|
||||
{
|
||||
float x, y, z, o;
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
if (!IsUnit(*itr))
|
||||
continue;
|
||||
|
||||
(*itr)->GetPosition(x, y, z, o);
|
||||
x += e.target.x;
|
||||
y += e.target.y;
|
||||
z += e.target.z;
|
||||
o += e.target.o;
|
||||
GetBaseObject()->SummonGameObject(e.action.summonGO.entry, x, y, z, o, 0, 0, 0, 0, e.action.summonGO.despawnTime);
|
||||
Position pos = (*itr)->GetPositionWithOffset(Position(e.target.x, e.target.y, e.target.z, e.target.o));
|
||||
GetBaseObject()->SummonGameObject(e.action.summonGO.entry, pos, G3D::Quat(), e.action.summonGO.despawnTime);
|
||||
}
|
||||
|
||||
delete targets;
|
||||
@@ -1262,7 +1257,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (e.GetTargetType() != SMART_TARGET_POSITION)
|
||||
break;
|
||||
|
||||
GetBaseObject()->SummonGameObject(e.action.summonGO.entry, e.target.x, e.target.y, e.target.z, e.target.o, 0, 0, 0, 0, e.action.summonGO.despawnTime);
|
||||
GetBaseObject()->SummonGameObject(e.action.summonGO.entry, Position(e.target.x, e.target.y, e.target.z, e.target.o), G3D::Quat(), e.action.summonGO.despawnTime);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_KILL_UNIT:
|
||||
|
||||
Reference in new issue
Block a user