Fix to shop, where a NULL object variable could cause a crash
This commit is contained in:
@@ -34,6 +34,8 @@ OLC copy and delete options.
|
|||||||
export (QQ's a zone into a tarball)t
|
export (QQ's a zone into a tarball)t
|
||||||
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
|
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
|
||||||
(lots of major bugfixes too)
|
(lots of major bugfixes too)
|
||||||
|
[Apr 13 2009] - Jamdog
|
||||||
|
Bug-Fix: Shopping for multiple items caused an occasional crash due to NULL variable - now fixed (I hope)
|
||||||
[Apr 12 2009] - Jamdog
|
[Apr 12 2009] - Jamdog
|
||||||
Bug-Fix: Stat player displayed current quest information incorrectly - fixed 'if'
|
Bug-Fix: Stat player displayed current quest information incorrectly - fixed 'if'
|
||||||
[Apr 11 2009] - Jamdog
|
[Apr 11 2009] - Jamdog
|
||||||
|
|||||||
@@ -609,7 +609,7 @@ static void shopping_buy(char *arg, struct char_data *ch, struct char_data *keep
|
|||||||
snprintf(buf, sizeof(buf), "%s Something screwy only gave you %d.", GET_NAME(ch), bought);
|
snprintf(buf, sizeof(buf), "%s Something screwy only gave you %d.", GET_NAME(ch), bought);
|
||||||
do_tell(keeper, buf, cmd_tell, 0);
|
do_tell(keeper, buf, cmd_tell, 0);
|
||||||
}
|
}
|
||||||
if (!IS_GOD(ch) && !OBJ_FLAGGED(obj, ITEM_QUEST)) {
|
if (!IS_GOD(ch) && obj && !OBJ_FLAGGED(obj, ITEM_QUEST)) {
|
||||||
GET_GOLD(keeper) += goldamt;
|
GET_GOLD(keeper) += goldamt;
|
||||||
if (SHOP_USES_BANK(shop_nr))
|
if (SHOP_USES_BANK(shop_nr))
|
||||||
if (GET_GOLD(keeper) > MAX_OUTSIDE_BANK) {
|
if (GET_GOLD(keeper) > MAX_OUTSIDE_BANK) {
|
||||||
@@ -622,7 +622,7 @@ static void shopping_buy(char *arg, struct char_data *ch, struct char_data *keep
|
|||||||
snprintf(tempbuf, sizeof(tempbuf), "$n buys %s.", tempstr);
|
snprintf(tempbuf, sizeof(tempbuf), "$n buys %s.", tempstr);
|
||||||
act(tempbuf, FALSE, ch, obj, 0, TO_ROOM);
|
act(tempbuf, FALSE, ch, obj, 0, TO_ROOM);
|
||||||
|
|
||||||
if (OBJ_FLAGGED(obj, ITEM_QUEST))
|
if (obj && OBJ_FLAGGED(obj, ITEM_QUEST))
|
||||||
snprintf(tempbuf, sizeof(tempbuf), "%s That has cost you %d quest points.", GET_NAME(ch), goldamt);
|
snprintf(tempbuf, sizeof(tempbuf), "%s That has cost you %d quest points.", GET_NAME(ch), goldamt);
|
||||||
else
|
else
|
||||||
snprintf(tempbuf, sizeof(tempbuf), shop_index[shop_nr].message_buy, GET_NAME(ch), goldamt);
|
snprintf(tempbuf, sizeof(tempbuf), shop_index[shop_nr].message_buy, GET_NAME(ch), goldamt);
|
||||||
|
|||||||
Reference in New Issue
Block a user