Gameobject refactoring #4968

Closed
wants to merge 12 commits into from

8 participants

@ghost

I ported the new rotation code to tc from Silverice.

Venugh added some commits Jan 7, 2012
Venugh Core/Globals: Check rotation0 and rotation1 fields at gameobject data…
… loading. Thx SilverIce
494154a
Venugh Merge branch 'master' of git://github.com/TrinityCore/TrinityCore int…
…o gameobject
ec969c9
Venugh Pack and send to client all gameobject's quaternion components which …
…allows place gameobjects cornerwise.

Update '.gobject turn' command, now you have to specify 3 rotations to turn gameobject: rotation angles around z, y and x axes.
Note to DB devs: use QuaternionCompressed::Unpack to extract rotations from the data that came with UPDATEFLAG_ROTATION.

Based from SilverIce.
3280625
Venugh Implement transport path rotation
Transport rotation transforms transport path - this makes possible to have few transports with same entry but with modified paths.
This also solvers problems with some transports (like deeprun tram).
TODO: some transports has non standart rotations, that must be stored in db

Signed-off-by: SilverIce <slifeleaf@gmail.com>
b4fc8d9
Venugh A bit gameobject code refactoring. based from SilverIce. 1cec44c
Venugh Add gameobject_addon table
table holds additional per-guid gameobject data.
currently it contains path rotation info that required for some elevators and transports

based from Silverice.
709227e
Venugh Typo in last commit. 973ee09
Venugh Core/Gameobjects: Use new rotation method in AddGoData. b477702
Venugh Use new rotation code in battlegroundsa. d557075
Venugh Correct size of animprogress for GO Create()
Add a default define and use it instead of hard coded value.
Some additional minor corrections for transport GO's

Signed-off-by: NoFantasy <nofantasy@nf.no>
cec264f
Venugh Merge branch 'master' of git://github.com/TrinityCore/TrinityCore int…
…o gameobject
d277c09
@2010phenix

+100500 man thanks

@ZxBiohazardZx

small suggestion to change gameobject_addon into transport_addon or something like that, as apparently the data is only set for transports and not gameobjects in general?

709227e also seems to be similar to the b4fc8d9 commit

@ghost

can you explain me for what it is good?

@Aokromes
TrinityCore member

To allow malcrom fixing quests :P

@Vincent-Michael
TrinityCore member

Or Naxxramas Teleporter at Maexxna

@Expecto

Transport System Fix?

@Subv

@Expecto what?

@sebid

Think he said sorry.

@FilipLukac FilipLukac and 2 others commented on an outdated diff Feb 4, 2012
src/server/game/Globals/ObjectMgr.cpp
+ do
+ {
+ Field* fields = result->Fetch();
+
+ uint32 guid = fields[0].GetUInt32();
+
+ if (mGameObjectDataMap.find(guid) == mGameObjectDataMap.end())
+ {
+ sLog->outErrorDb("Gameobject (GUID: %u) does not exist but has a record in `gameobject_addon`", guid);
+ continue;
+ }
+
+ GameObjectDataAddon& gameObjectAddon = GameObjectAddonStore[guid];
+
+ gameObjectAddon.path_rotation.x = fields[1].GetUInt32();
+ gameObjectAddon.path_rotation.y = fields[2].GetUInt32();

Not GetFloat() ?

@ghost
ghost added a note Feb 4, 2012

yes correct ^^

@Subv
Subv added a note Feb 5, 2012

@Venugh use GetFloat instead of GetUInt32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@FilipLukac FilipLukac commented on the diff Feb 4, 2012
src/server/game/Globals/ObjectMgr.cpp
@@ -1866,6 +1878,61 @@ void ObjectMgr::LoadGameobjects()
sLog->outString();
}
+void ObjectMgr::LoadGameObjectAddon()
+{
+ uint32 oldMSTime = getMSTime();
+
+ // 0 1 2 3 4
+ QueryResult result = WorldDatabase.Query("SELECT guid, path_rotation0, path_rotation1, path_rotation2, path_rotation3, FROM gameobject_addon");
+
+ if (!result)
+ {
+ sLog->outErrorDb(">> Loaded 0 gameobjects addon definitions. DB table `gameobject_addon` is empty.");
+ sLog->outString();
+ return;
+ }
+
+ uint32 count = 0;

Unused variable, missing ++count at do loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ghost

Fixed :)

@n4ndo

why this is not on master yet?

@Aokromes
TrinityCore member

PR with merges are evil :) plz remake the PR with a single commit better than 10 :)

@ghost ghost closed this Feb 24, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment