mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-23 10:40:13 +01:00
Two bug fixes (Thanks Slicer) in CAP (utils.c) and delete_object (genobj.c)
This commit is contained in:
parent
b35073602f
commit
2d52e5cb67
3 changed files with 215 additions and 203 deletions
|
|
@ -35,6 +35,9 @@ 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)
|
||||||
tbaMUD 3.59
|
tbaMUD 3.59
|
||||||
|
[Mar 08 2009] - Jamdog
|
||||||
|
Fixed a possible crash bug in delete_object (genobj.c) (Thanks Slicer)
|
||||||
|
CAP function now recognises both preceeding color codes and ANSI codes (Thanks Slicer)
|
||||||
[Mar 07 2009] - Jamdog
|
[Mar 07 2009] - Jamdog
|
||||||
Fixed a bug in find_shop (shop.c) and real_shop (genshp.c) (Thanks Slicer)
|
Fixed a bug in find_shop (shop.c) and real_shop (genshp.c) (Thanks Slicer)
|
||||||
[Feb 25 2009] - Jamdog
|
[Feb 25 2009] - Jamdog
|
||||||
|
|
|
||||||
|
|
@ -374,7 +374,7 @@ int delete_object(obj_rnum rnum)
|
||||||
{
|
{
|
||||||
obj_rnum i;
|
obj_rnum i;
|
||||||
zone_rnum zrnum;
|
zone_rnum zrnum;
|
||||||
struct obj_data *obj, *tmp;
|
struct obj_data *obj, *tmp, *next_obj;
|
||||||
int shop, j, zone, cmd_no;
|
int shop, j, zone, cmd_no;
|
||||||
|
|
||||||
if (rnum == NOTHING || rnum > top_of_objt)
|
if (rnum == NOTHING || rnum > top_of_objt)
|
||||||
|
|
@ -387,7 +387,8 @@ int delete_object(obj_rnum rnum)
|
||||||
/* This is something you might want to read about in the logs. */
|
/* This is something you might want to read about in the logs. */
|
||||||
log("GenOLC: delete_object: Deleting object #%d (%s).", GET_OBJ_VNUM(obj), obj->short_description);
|
log("GenOLC: delete_object: Deleting object #%d (%s).", GET_OBJ_VNUM(obj), obj->short_description);
|
||||||
|
|
||||||
for (tmp = object_list; tmp; tmp = tmp->next) {
|
for (tmp = object_list; tmp; tmp = next_obj) {
|
||||||
|
next_obj = tmp->next;
|
||||||
if (tmp->item_number != obj->item_number)
|
if (tmp->item_number != obj->item_number)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
||||||
12
src/utils.c
12
src/utils.c
|
|
@ -89,8 +89,16 @@ char *CAP(char *txt)
|
||||||
{
|
{
|
||||||
char *p = txt;
|
char *p = txt;
|
||||||
|
|
||||||
while (*p == '@' && *(p+1))
|
/* Skip all preceeding color codes and ANSI codes */
|
||||||
p += 2;
|
while ((*p == '@' && *(p+1)) || (*p == '\x1B' && *(p+1) == '[')) {
|
||||||
|
if (*p == '@') p += 2; /* Skip @ sign and color letter/number */
|
||||||
|
else {
|
||||||
|
p += 2; /* Skip the CSI section of the ANSI code */
|
||||||
|
while (*p && !isalpha(*p)) p++; /* Skip until a 'letter' is found */
|
||||||
|
if (*p) p++; /* Skip the letter */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (*p)
|
if (*p)
|
||||||
*p = UPPER(*p);
|
*p = UPPER(*p);
|
||||||
return (txt);
|
return (txt);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue