… | |
… | |
29 | #include <sys/types.h> |
29 | #include <sys/types.h> |
30 | #include <sys/uio.h> |
30 | #include <sys/uio.h> |
31 | #include <object.h> |
31 | #include <object.h> |
32 | #include <funcpoint.h> |
32 | #include <funcpoint.h> |
33 | #include <loader.h> |
33 | #include <loader.h> |
|
|
34 | |
|
|
35 | #include <bitset> |
34 | |
36 | |
35 | int nrofallocobjects = 0; |
37 | int nrofallocobjects = 0; |
36 | static UUID uuid; |
38 | static UUID uuid; |
37 | const uint64 UUID_SKIP = 1<<19; |
39 | const uint64 UUID_SKIP = 1<<19; |
38 | |
40 | |
… | |
… | |
220 | |
222 | |
221 | if (QUERY_FLAG (ob2, FLAG_IDENTIFIED)) |
223 | if (QUERY_FLAG (ob2, FLAG_IDENTIFIED)) |
222 | SET_FLAG (ob2, FLAG_BEEN_APPLIED); |
224 | SET_FLAG (ob2, FLAG_BEEN_APPLIED); |
223 | |
225 | |
224 | |
226 | |
225 | /* the 0x400000 on flags2 is FLAG_INV_LOCK. I don't think something |
227 | if ((ob1->flags ^ ob2->flags).reset (FLAG_INV_LOCKED).reset (FLAG_CLIENT_SENT).any () |
226 | * being locked in inventory should prevent merging. |
228 | || ob1->arch != ob2->arch |
227 | * 0x4 in flags3 is CLIENT_SENT |
|
|
228 | */ |
|
|
229 | if ((ob1->arch != ob2->arch) || |
|
|
230 | (ob1->flags[0] != ob2->flags[0]) || |
|
|
231 | (ob1->flags[1] != ob2->flags[1]) || |
|
|
232 | ((ob1->flags[2] & ~0x400000) != (ob2->flags[2] & ~0x400000)) || |
|
|
233 | ((ob1->flags[3] & ~0x4) != (ob2->flags[3] & ~0x4)) || |
|
|
234 | (ob1->name != ob2->name) || |
229 | || ob1->name != ob2->name |
235 | (ob1->title != ob2->title) || |
230 | || ob1->title != ob2->title |
236 | (ob1->msg != ob2->msg) || |
231 | || ob1->msg != ob2->msg |
237 | (ob1->weight != ob2->weight) || |
232 | || ob1->weight != ob2->weight |
238 | (memcmp (&ob1->resist, &ob2->resist, sizeof (ob1->resist)) != 0) || |
233 | || memcmp (&ob1->resist, &ob2->resist, sizeof (ob1->resist)) |
239 | (memcmp (&ob1->stats, &ob2->stats, sizeof (ob1->stats)) != 0) || |
234 | || memcmp (&ob1->stats , &ob2->stats , sizeof (ob1->stats) ) |
240 | (ob1->attacktype != ob2->attacktype) || |
235 | || ob1->attacktype != ob2->attacktype |
241 | (ob1->magic != ob2->magic) || |
236 | || ob1->magic != ob2->magic |
242 | (ob1->slaying != ob2->slaying) || |
237 | || ob1->slaying != ob2->slaying |
243 | (ob1->skill != ob2->skill) || |
238 | || ob1->skill != ob2->skill |
244 | (ob1->value != ob2->value) || |
239 | || ob1->value != ob2->value |
245 | (ob1->animation_id != ob2->animation_id) || |
240 | || ob1->animation_id != ob2->animation_id |
246 | (ob1->client_type != ob2->client_type) || |
241 | || ob1->client_type != ob2->client_type |
247 | (ob1->materialname != ob2->materialname) || |
242 | || ob1->materialname != ob2->materialname |
248 | (ob1->lore != ob2->lore) || |
243 | || ob1->lore != ob2->lore |
249 | (ob1->subtype != ob2->subtype) || |
244 | || ob1->subtype != ob2->subtype |
250 | (ob1->move_type != ob2->move_type) || |
245 | || ob1->move_type != ob2->move_type |
251 | (ob1->move_block != ob2->move_block) || |
246 | || ob1->move_block != ob2->move_block |
252 | (ob1->move_allow != ob2->move_allow) || |
247 | || ob1->move_allow != ob2->move_allow |
253 | (ob1->move_on != ob2->move_on) || |
248 | || ob1->move_on != ob2->move_on |
254 | (ob1->move_off != ob2->move_off) || (ob1->move_slow != ob2->move_slow) || (ob1->move_slow_penalty != ob2->move_slow_penalty)) |
249 | || ob1->move_off != ob2->move_off |
|
|
250 | || ob1->move_slow != ob2->move_slow |
|
|
251 | || ob1->move_slow_penalty != ob2->move_slow_penalty) |
255 | return 0; |
252 | return 0; |
256 | |
253 | |
257 | /* This is really a spellbook check - really, we should |
254 | /* This is really a spellbook check - really, we should |
258 | * check all objects in the inventory. |
255 | * check all objects in the inventory. |
259 | */ |
256 | */ |