Switch to using atoidx whenever we are handling an IDXTYPE. cleanup and linting of asciimap.c

This commit is contained in:
welcor
2024-12-31 00:18:53 +01:00
parent 9c5787129b
commit b489a72c58
28 changed files with 478 additions and 422 deletions

View File

@@ -88,7 +88,7 @@ room_rnum obj_room(obj_data *obj)
/* returns the real room number, or NOWHERE if not found or invalid */
static room_rnum find_obj_target_room(obj_data *obj, char *rawroomstr)
{
int tmp;
room_vnum tmp;
room_rnum location;
char_data *target_mob;
obj_data *target_obj;
@@ -101,7 +101,7 @@ static room_rnum find_obj_target_room(obj_data *obj, char *rawroomstr)
if (isdigit(*roomstr) && !strchr(roomstr, '.'))
{
tmp = atoi(roomstr);
tmp = atoidx(roomstr);
if ((location = real_room(tmp)) == NOWHERE)
return NOWHERE;
}
@@ -220,7 +220,7 @@ static OCMD(do_ozoneecho)
if (!*room_number || !*msg)
obj_log(obj, "ozoneecho called with too few args");
else if ((zone = real_zone_by_thing(atoi(room_number))) == NOWHERE)
else if ((zone = real_zone_by_thing(atoidx(room_number))) == NOWHERE)
obj_log(obj, "ozoneecho called for nonexistant zone");
else {
@@ -275,7 +275,7 @@ static OCMD(do_orecho)
if (!*msg || !*start || !*finish || !is_number(start) || !is_number(finish))
obj_log(obj, "orecho: too few args");
else
send_to_range(atoi(start), atoi(finish), "%s\r\n", msg);
send_to_range(atoidx(start), atoidx(finish), "%s\r\n", msg);
}
@@ -310,7 +310,7 @@ static OCMD(do_otransform)
else if (!isdigit(*arg))
obj_log(obj, "otransform: bad argument");
else {
o = read_object(atoi(arg), VIRTUAL);
o = read_object(atoidx(arg), VIRTUAL);
if (o==NULL) {
obj_log(obj, "otransform: bad object vnum");
return;
@@ -459,7 +459,7 @@ static OCMD(do_dgoload)
target = two_arguments(argument, arg1, arg2);
if (!*arg1 || !*arg2 || !is_number(arg2) || ((number = atoi(arg2)) < 0))
if (!*arg1 || !*arg2 || !is_number(arg2) || ((number = atoidx(arg2)) == NOTHING))
{
obj_log(obj, "oload: bad syntax");
return;
@@ -477,7 +477,7 @@ static OCMD(do_dgoload)
if (!target || !*target) {
rnum = room;
} else {
if (!isdigit(*target) || (rnum = real_room(atoi(target))) == NOWHERE) {
if (!isdigit(*target) || (rnum = real_room(atoidx(target))) == NOWHERE) {
obj_log(obj, "oload: room target vnum doesn't exist "
"(loading mob vnum %d to room %s)", number, target);
return;
@@ -671,7 +671,7 @@ static OCMD(do_odoor)
newexit->exit_info = (sh_int)asciiflag_conv(value);
break;
case 3: /* key */
newexit->key = atoi(value);
newexit->key = atoidx(value);
break;
case 4: /* name */
if (newexit->keyword)
@@ -680,7 +680,7 @@ static OCMD(do_odoor)
strcpy(newexit->keyword, value);
break;
case 5: /* room */
if ((to_room = real_room(atoi(value))) != NOWHERE)
if ((to_room = real_room(atoidx(value))) != NOWHERE)
newexit->to_room = to_room;
else
obj_log(obj, "odoor: invalid door target");
@@ -743,7 +743,7 @@ static OCMD(do_oat)
return;
}
if (isdigit(*arg)) loc = real_room(atoi(arg));
if (isdigit(*arg)) loc = real_room(atoidx(arg));
else if ((ch = get_char_by_obj(obj, arg))) loc = IN_ROOM(ch);
if (loc == NOWHERE) {