yeah, I ran the configure file before compile the code for the first time.
my change was:
added to utils.h:
/** What ch is currently resting on. */
#define RESTING(ch) ((ch)->char_specials.furniture)
/** Who is resting next to ch, if anyone. */
#define NEXT_RESTING(ch) ((ch)->char_specials.next_resting_in_furniture)
/** Who is resting on this obj */
#define OBJ_REST_IN_BY(obj) ((obj)->resting_here)
/** What ch is currently sleeping on. */
#define SLEEPING(ch) ((ch)->char_specials.furniture)
/** Who is sleeping next to ch, if anyone. */
#define NEXT_SLEEPING(ch) ((ch)->char_specials.next_sleeping_in_furniture)
/** Who is sleeping on this obj */
#define OBJ_SLEPT_IN_BY(obj) ((obj)->sleeping_here)
*I change next_in_furniture to next_sitting_in_furniture to make sense
to structs.h:
in struct char_special_data
struct char_data *next_sitting_in_furniture; /**< Next person sitting, else NULL */
struct char_data *next_resting_in_furniture; /**< Next person resting , else NULL */
struct char_data *next_sleeping_in_furniture; /**< Next person sleeping , else NULL */
(I don't add resting/sleeping_where like sitting_where cause I didn't implement the properly changes to do_rest and do_sleep)
and the method do_sit, at act.moviment.c:
ACMD(do_sit)
{
char arg[MAX_STRING_LENGTH];
struct obj_data *furniture;
struct char_data *tempch;
int found;
one_argument(argument, arg);
if (!*arg)
found = -1;
if (!(furniture = get_obj_in_list_vis(ch, arg, NULL, world[ch->in_room].contents)))
found = 0;
else
found = 1;
switch (GET_POS(ch)) {
case POS_STANDING:
if (found == -1) {
send_to_char(ch, "You sit down.\r\n");
act("$n sits down.", FALSE, ch, 0, 0, TO_ROOM);
GET_POS(ch) = POS_SITTING;
} else if (found == 0) {
send_to_char(ch, "Sentar onde?\r\n");
} else {
if (GET_OBJ_TYPE(furniture) != ITEM_FURNITURE) {
send_to_char(ch, "You can't sit on that!\r\n");
return;
} else if (GET_OBJ_VAL(furniture, 1) > GET_OBJ_VAL(furniture, 0)) {
/* Val 1 is current number sitting, 0 is max in sitting. */
act("$p looks like it's all full.", TRUE, ch, furniture, 0, TO_CHAR);
log("SYSERR: Furniture %d holding too many people.", GET_OBJ_VNUM(furniture));
return;
} else if (GET_OBJ_VAL(furniture, 1) == GET_OBJ_VAL(furniture, 0)) {
act("There is no where left to sit upon $p.", TRUE, ch, furniture, 0, TO_CHAR);
return;
} else {
if (OBJ_SAT_IN_BY(furniture) == NULL)
OBJ_SAT_IN_BY(furniture) = ch;
for (tempch = OBJ_SAT_IN_BY(furniture); tempch != ch ; tempch = NEXT_SITTING(tempch)) {
if (NEXT_SITTING(tempch))
continue;
NEXT_SITTING(tempch) = ch;
}
act("You sit down upon $p.", TRUE, ch, furniture, 0, TO_CHAR);
act("$n sits down upon $p.", TRUE, ch, furniture, 0, TO_ROOM);
SITTING(ch) = furniture;
NEXT_SITTING(ch) = NULL;
GET_OBJ_VAL(furniture, 1) += 1;
GET_POS(ch) = POS_SITTING;
}
}
break;
case POS_SITTING:
send_to_char(ch, "You're sitting already.\r\n");
break;
case POS_RESTING:
send_to_char(ch, "You stop resting, and sit up.\r\n");
act("$n stops resting.", TRUE, ch, 0, 0, TO_ROOM);
GET_POS(ch) = POS_SITTING;
break;
case POS_SLEEPING:
send_to_char(ch, "You have to wake up first.\r\n");
break;
case POS_FIGHTING:
send_to_char(ch, "Sit down while fighting? Are you MAD?\r\n");
break;
default:
send_to_char(ch, "You stop floating around, and sit down.\r\n");
act("$n stops floating around, and sits down.", TRUE, ch, 0, 0, TO_ROOM);
GET_POS(ch) = POS_SITTING;
break;
}
}
I just change to know when people don't find anything to sit down and informe it.