--- deliantra/server/common/item.C 2008/04/21 23:35:24 1.47 +++ deliantra/server/common/item.C 2008/04/25 11:40:34 1.49 @@ -301,9 +301,11 @@ for (i = 1; i < NROFATTACKS; i++) if (op->attacktype & (1 << i)) enc++; + if (op->slaying) enc += 2; /* What it slays is probably more relevent */ } + /* Items the player can equip */ if ((op->type == WEAPON) || (op->type == ARMOUR) || (op->type == HELMET) || (op->type == SHIELD) || (op->type == RING) || @@ -316,6 +318,7 @@ enc += op->stats.grace; /* grace regen */ enc += op->stats.exp; /* speed bonus */ } + enc += op->stats.luck; /* Do spell paths now */ @@ -357,6 +360,7 @@ for (i = 0; i < item_types_size; i++) if (item_types[i].number == itemtype) return &item_types[i]; + return NULL; } @@ -371,13 +375,15 @@ for (i = 0; i < item_types_size; i++) if (!strcmp (item_types[i].name, name)) return &item_types[i]; + for (i = 0; i < item_types_size; i++) if (!strcmp (item_types[i].name_pl, name)) { LOG (llevInfo, - "get_typedata_by_name: I have been sent the plural %s, the singular form %s is preffered\n", name, item_types[i].name); + "get_typedata_by_name: I have been sent the plural %s, the singular form %s is prefered\n", name, item_types[i].name); return &item_types[i]; } + return NULL; } @@ -1358,8 +1364,6 @@ void identify (object *op) { - object *pl; - SET_FLAG (op, FLAG_IDENTIFIED); CLEAR_FLAG (op, FLAG_KNOWN_MAGICAL); CLEAR_FLAG (op, FLAG_NO_SKILL_IDENT); @@ -1376,7 +1380,7 @@ op->title = op->inv->name; else if (op->arch) { - op->name = op->arch->object::name; + op->name = op->arch->object::name; op->name_pl = op->arch->object::name_pl; } } @@ -1384,14 +1388,10 @@ /* If the object is on a map, make sure we update its face */ if (op->map) update_object (op, UP_OBJ_CHANGE); - else - { - pl = op->in_player (); - if (pl) - /* A lot of the values can change from an update - might as well send - * it all. - */ - esrv_send_item (pl, op); - } + else if (object *pl = op->visible_to ()) + /* A lot of the values can change from an update - might as well send + * it all. + */ + esrv_send_item (pl, op); }