1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2001 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2001 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
… | |
… | |
351 | /* inventory ok - still need to check rest of this object to see |
351 | /* inventory ok - still need to check rest of this object to see |
352 | * if it is valid. |
352 | * if it is valid. |
353 | */ |
353 | */ |
354 | } |
354 | } |
355 | |
355 | |
356 | /* Don't merge objects that are applied. With the new 'body' code, |
356 | /* Don't merge objects that are applied. With the new 'body' code, |
357 | * it is possible for most any character to have more than one of |
357 | * it is possible for most any character to have more than one of |
358 | * some items equipped, and we don't want those to merge. |
358 | * some items equipped, and we don't want those to merge. |
359 | */ |
359 | */ |
360 | if (ob1->flag [FLAG_APPLIED] || ob2->flag [FLAG_APPLIED]) |
360 | if (ob1->flag [FLAG_APPLIED] || ob2->flag [FLAG_APPLIED]) |
361 | return 0; |
361 | return 0; |
362 | |
362 | |
363 | /* Note sure why the following is the case - either the object has to |
363 | /* Not sure why the following is the case - either the object has to |
364 | * be animated or have a very low speed. Is this an attempted monster |
364 | * be animated or have a very low speed. Is this an attempted monster |
365 | * check? |
365 | * check? |
366 | */ |
366 | */ |
367 | if (!ob1->flag [FLAG_ANIMATE] && ob1->has_active_speed ()) |
367 | if (!ob1->flag [FLAG_ANIMATE] && ob1->has_active_speed ()) |
368 | return 0; |
368 | return 0; |
369 | |
369 | |
… | |
… | |
636 | speed_left = -1.; |
636 | speed_left = -1.; |
637 | |
637 | |
638 | /* copy the body_info to the body_used - this is only really |
638 | /* copy the body_info to the body_used - this is only really |
639 | * need for monsters, but doesn't hurt to do it for everything. |
639 | * need for monsters, but doesn't hurt to do it for everything. |
640 | * by doing so, when a monster is created, it has good starting |
640 | * by doing so, when a monster is created, it has good starting |
641 | * values for the body_used info, so when items are created |
641 | * values for the body_used info, so when items are created |
642 | * for it, they can be properly equipped. |
642 | * for it, they can be properly equipped. |
643 | */ |
643 | */ |
644 | for (int i = NUM_BODY_LOCATIONS; i--; ) |
644 | for (int i = NUM_BODY_LOCATIONS; i--; ) |
645 | slot[i].used = slot[i].info; |
645 | slot[i].used = slot[i].info; |
646 | |
646 | |
… | |
… | |
1678 | /* |
1678 | /* |
1679 | * env->insert (op) |
1679 | * env->insert (op) |
1680 | * This function inserts the object op in the linked list |
1680 | * This function inserts the object op in the linked list |
1681 | * inside the object environment. |
1681 | * inside the object environment. |
1682 | * |
1682 | * |
1683 | * The function returns now pointer to inserted item, and return value can |
1683 | * The function returns now pointer to inserted item, and return value can |
1684 | * be != op, if items are merged. -Tero |
1684 | * be != op, if items are merged. -Tero |
1685 | */ |
1685 | */ |
1686 | object * |
1686 | object * |
1687 | object::insert (object *op) |
1687 | object::insert (object *op) |
1688 | { |
1688 | { |