Code:
static int isLitLocation(char_data *i) {
return !ROOM_FLAGGED(IN_ROOM(i), ROOM_DARK) &&
!ROOM_FLAGGED(IN_ROOM(i), ROOM_INDOORS) &&
!ROOM_FLAGGED(IN_ROOM(i), ROOM_TUNNEL) &&
weather_info.sunlight == SUN_LIGHT;
/* ((time_info.hours >= 5) && (time_info.hours <= 21)); */
}
static int isLightSensitive(char_data *i) {
return GET_RACE(i) == RACE_DROW
&& !IS_AFFECTED(i, SPELL_GLOBE_OF_DARKNESS);
}
/* Update PCs, NPCs, and objects */
void point_update(void)
{
struct char_data *i, *next_char;
struct obj_data *j, *next_thing, *jj, *next_thing2;
/* struct char_data *ch; */
/* characters */
for (i = character_list; i; i = next_char) {
next_char = i->next;
gain_condition(i, HUNGER, -1);
gain_condition(i, DRUNK, -1);
gain_condition(i, THIRST, -1);
if (GET_POS(i) >= POS_STUNNED) {
GET_HIT(i) = MIN(GET_HIT(i) + hit_gain(i), GET_MAX_HIT(i));
GET_MANA(i) = MIN(GET_MANA(i) + mana_gain(i), GET_MAX_MANA(i));
GET_MOVE(i) = MIN(GET_MOVE(i) + move_gain(i), GET_MAX_MOVE(i));
if (AFF_FLAGGED(i, AFF_POISON))
if (damage(i, i, 2, SPELL_POISON) == -1)
continue; /* Oops, they died. -gg 6/24/98 */
/* if ((!ROOM_FLAGGED(IN_ROOM(i), ROOM_DARK) && (!ROOM_FLAGGED(IN_ROOM(i), ROOM_INDOORS)) && (!ROOM_FLAGGED(IN_ROOM(i), ROOM_TUNNEL))) && (GET_RACE(i) == RACE_DROW) && (!AFF_FLAGGED(i, AFF_GLOBE_OF_DARKNESS)))
if (damage(i, i, GET_LEVEL(i), SPELL_SUN_LIGHT) == -1)
continue; */
if (isLightSensitive(i) && isLitLocation(i))
if (damage(i, i, GET_LEVEL(i), SPELL_SUN_LIGHT) == -1)
continue;
if (GET_POS(i) <= POS_STUNNED)
update_pos(i);
} else if (GET_POS(i) == POS_INCAP) {
if (damage(i, i, 1, TYPE_SUFFERING) == -1)
continue;
} else if (GET_POS(i) == POS_MORTALLYW) {
if (damage(i, i, 2, TYPE_SUFFERING) == -1)
continue;
}
if (!IS_NPC(i)) {
update_char_objects(i);
(i->char_specials.timer)++;
if (GET_LEVEL(i) < CONFIG_IDLE_MAX_LEVEL)
check_idling(i);
}
}