How is it not a vehicle bug?
My character sleeps just fine everywhere except in the vehicle mounted bed.[/quote]
This might actually be a bug. Beds have a bonus to sleepiness. Even a car seat has a bonus, equivalent to a makeshift bed or cot. But car beds don’t seem to. Even the ground has a +1 bonus (cot has +4, real bed has +5) but car beds don’t seem to. Car beds trigger the “comfortable place to sleep” message, but they don’t provide a bonus to sleepiness like other beds. They probably overlooked this when they added car beds.
void player::try_to_sleep(game *g)
{
int vpart = -1;
vehicle *veh = g->m.veh_at (posx, posy, vpart);
if (g->m.ter(posx, posy) == t_bed || g->m.ter(posx, posy) == t_makeshift_bed ||
g->m.tr_at(posx, posy) == tr_cot || g->m.tr_at(posx, posy) == tr_rollmat ||
(veh && veh->part_with_feature (vpart, vpf_seat) >= 0) ||
(veh && veh->part_with_feature (vpart, vpf_bed) >= 0))
g->add_msg("This is a comfortable place to sleep.");
else if (g->m.ter(posx, posy) != t_floor)
g->add_msg("It's %shard to get to sleep on this %s.",
terlist[g->m.ter(posx, posy)].movecost <= 2 ? "a little " : "",
terlist[g->m.ter(posx, posy)].name.c_str());
add_disease(DI_LYING_DOWN, 300, g);
}
bool player::can_sleep(game *g)
{
int sleepy = 0;
if (has_addiction(ADD_SLEEP))
sleepy -= 3;
if (has_trait(PF_INSOMNIA))
sleepy -= 8;
int vpart = -1;
vehicle *veh = g->m.veh_at (posx, posy, vpart);
if ((veh && veh->part_with_feature (vpart, vpf_seat) >= 0) ||
g->m.ter(posx, posy) == t_makeshift_bed || g->m.tr_at(posx, posy) == tr_cot)
sleepy += 4;
else if (g->m.tr_at(posx, posy) == tr_rollmat)
sleepy += 3;
else if (g->m.ter(posx, posy) == t_bed)
sleepy += 5;
else if (g->m.ter(posx, posy) == t_floor)
sleepy += 1;
else
sleepy -= g->m.move_cost(posx, posy);
if (fatigue < 192)
sleepy -= int( (192 - fatigue) / 4);
else
sleepy += int((fatigue - 192) / 16);
sleepy += rng(-8, 8);
sleepy -= 2 * stim;
if (sleepy > 0)
return true;
return false;
}