PDA

View Full Version : Dropped object problem?


Scorpious2k
01-06-2004, 02:16 AM
I haven't heard of any problems related to dropped objects, but I found this interesting:

// Loading object from client dropping item on ground
Object::Object(Client* client, const ItemInst* inst)
{
// Invoke base class
Entity::Entity();

// Initialize members
m_id = 0;
m_inst = (inst) ? inst->Clone() : NULL;
m_type = OT_DROPPEDITEM;
m_icon = 0;
m_inuse = false;
m_ground_spawn = false;
// Set as much struct data as we can
memset(&m_data, 0, sizeof(Object_Struct));
m_data.heading = client->GetHeading();
m_data.y = client->GetX();
m_data.x = client->GetY();
m_data.z = client->GetZ();
m_data.zone_id = zone->GetZoneID();

Notice the values assigned to m_data.x and m_data.y

Trumpcard
01-06-2004, 02:26 AM
We have these all over the place, this is because we decided long ago to use the x,y format where live uses y,x

I thought the same thing when I initially say x being set to y (i was looking at mob position update packets)

If dropped objects are appearing in the right place, then this is a non issue.

Scorpious2k
01-06-2004, 02:27 AM
Here it is again in client_process.cpp:

zp->zpe[count].x = data->target_y;
zp->zpe[count].y = data->target_x; //Backwards to convert to eqlives standard..

While I know SOE has X & Y backwards, I had always assumed that this was corrected by naming field (or misnaming them) in the packet structures so the correct values went to the correvt places; ie the Y coord for eqemu is the X for SOE, so in the packet it is called X...

Am I working under a wrong understanding?

Trumpcard
01-06-2004, 03:20 AM
I think thats a better way too, but alas, not done...

I think its just mixed/matched because so many hands have been in there, so no one has gone in and applied a good consistant solution..

kathgar
01-06-2004, 03:46 AM
Not to mention the define INVERSEXY.. I don't think the code will work right at all without it. We should decide on how we want it done, document it clearly and just run with it. A lot of code to mess with either way though.

Trumpcard
01-06-2004, 05:39 AM
Actually, i searched through the code for that define, if i remember correctly its only used once in world (maybe not at all anymore)

Lurker_005
01-06-2004, 05:49 AM
yea but how many places is x assigned to y and vice versa? without a nice comment saying "leave it the F*** alone" :P