int command_markpos(char *text, int len) { int map_x, map_y; char *ptr = text; char msg[512]; const char *usage = help_cmd_markpos_str; while (isspace(*ptr)) ptr++; if (sscanf(ptr, "%d,%d ", &map_x, &map_y) != 2) { LOG_TO_CONSOLE(c_red2, usage); return 1; } while (*ptr != ' ' && *ptr) ptr++; while (*ptr == ' ') ptr++; if (!*ptr) { LOG_TO_CONSOLE(c_red2, usage); return 1; } if (put_mark_on_position(map_x, map_y, ptr)) { safe_snprintf (msg, sizeof(msg), location_info_str, map_x, map_y, ptr); LOG_TO_CONSOLE(c_orange1,msg); } else { safe_snprintf (msg,sizeof(msg), invalid_location_str, map_x, map_y); LOG_TO_CONSOLE(c_red2,msg); } return 1; }
int put_mark_on_current_position(const char *name) { actor *me = get_our_actor (); if (me != NULL) { if (put_mark_on_position(me->x_tile_pos, me->y_tile_pos, name)) return 1; } return 0; }
void put_mark_on_current_position(char *name) { actor *me = get_our_actor (); if (me != NULL) { put_mark_on_position(me->x_tile_pos, me->y_tile_pos, name); /* Lachesis: reusing available code marks[max_mark].x = me->x_tile_pos; marks[max_mark].y = me->y_tile_pos; memset(marks[max_mark].text,0,500); my_strncp(marks[max_mark].text,name,500); marks[max_mark].text[strlen(marks[max_mark].text)]=0; max_mark++; save_markings(); */ } }