… | |
… | |
286 | || ob1->skill != ob2->skill |
286 | || ob1->skill != ob2->skill |
287 | || ob1->value != ob2->value |
287 | || ob1->value != ob2->value |
288 | || ob1->animation_id != ob2->animation_id |
288 | || ob1->animation_id != ob2->animation_id |
289 | || (ob1->face != ob2->face && !ob1->animation_id) // face and animation are dependent on each other |
289 | || (ob1->face != ob2->face && !ob1->animation_id) // face and animation are dependent on each other |
290 | || ob1->client_type != ob2->client_type |
290 | || ob1->client_type != ob2->client_type |
291 | || ob1->materialname != ob2->materialname |
291 | || ob1->material != ob2->material |
292 | || ob1->lore != ob2->lore |
292 | || ob1->lore != ob2->lore |
293 | || ob1->subtype != ob2->subtype |
293 | || ob1->subtype != ob2->subtype |
294 | || ob1->move_type != ob2->move_type |
294 | || ob1->move_type != ob2->move_type |
295 | || ob1->move_block != ob2->move_block |
295 | || ob1->move_block != ob2->move_block |
296 | || ob1->move_allow != ob2->move_allow |
296 | || ob1->move_allow != ob2->move_allow |
… | |
… | |
844 | object::object () |
844 | object::object () |
845 | { |
845 | { |
846 | SET_FLAG (this, FLAG_REMOVED); |
846 | SET_FLAG (this, FLAG_REMOVED); |
847 | |
847 | |
848 | //expmul = 1.0; declared const for the time being |
848 | //expmul = 1.0; declared const for the time being |
849 | face = blank_face; |
849 | face = blank_face; |
|
|
850 | material = MATERIAL_NULL; |
850 | } |
851 | } |
851 | |
852 | |
852 | object::~object () |
853 | object::~object () |
853 | { |
854 | { |
854 | unlink (); |
855 | unlink (); |
… | |
… | |
1568 | return where->env->insert (this); |
1569 | return where->env->insert (this); |
1569 | else |
1570 | else |
1570 | return where->map->insert (this, where->x, where->y, originator, flags); |
1571 | return where->map->insert (this, where->x, where->y, originator, flags); |
1571 | } |
1572 | } |
1572 | |
1573 | |
1573 | // check whether we can put this into the map, respect max_nrof, max_volume, max_items |
1574 | // check whether we can put this into the map, respect max_volume, max_items |
1574 | bool |
1575 | bool |
1575 | object::can_drop_at (maptile *m, int x, int y, object *originator) |
1576 | object::can_drop_at (maptile *m, int x, int y, object *originator) |
1576 | { |
1577 | { |
1577 | mapspace &ms = m->at (x, y); |
1578 | mapspace &ms = m->at (x, y); |
1578 | |
1579 | |
1579 | int items = ms.items (); |
1580 | int items = ms.items (); |
1580 | |
1581 | |
1581 | if (!items // testing !items ensures we can drop at least one item |
1582 | if (!items // testing !items ensures we can drop at least one item |
1582 | || (items < m->max_items |
1583 | || (items < m->max_items |
1583 | && ms.volume () < m->max_volume |
1584 | && ms.volume () < m->max_volume)) |
1584 | && nrof <= m->max_nrof)) |
|
|
1585 | return true; |
1585 | return true; |
1586 | |
1586 | |
1587 | if (originator && originator->is_player ()) |
1587 | if (originator && originator->is_player ()) |
1588 | originator->contr->failmsg (format ( |
1588 | originator->contr->failmsg (format ( |
1589 | "No matter how hard you try, you just cannot put the %s here H<Try to remove some items from the floor first.>", |
1589 | "No matter how hard you try, you just cannot put the %s here H<Try to remove some items from the floor first.>", |
… | |
… | |
2518 | { |
2518 | { |
2519 | return map ? map->region (x, y) |
2519 | return map ? map->region (x, y) |
2520 | : region::default_region (); |
2520 | : region::default_region (); |
2521 | } |
2521 | } |
2522 | |
2522 | |
2523 | const materialtype_t * |
|
|
2524 | object::dominant_material () const |
|
|
2525 | { |
|
|
2526 | if (materialtype_t *mt = name_to_material (materialname)) |
|
|
2527 | return mt; |
|
|
2528 | |
|
|
2529 | return name_to_material (shstr_unknown); |
|
|
2530 | } |
|
|
2531 | |
|
|
2532 | void |
2523 | void |
2533 | object::open_container (object *new_container) |
2524 | object::open_container (object *new_container) |
2534 | { |
2525 | { |
2535 | if (container == new_container) |
2526 | if (container == new_container) |
2536 | return; |
2527 | return; |