.time day / night: change the sky and the light, not only the clock

The client takes the frozen clock in the middle of a session (its clock
shows 12:00) but does not light the world again from it, so the sky
stayed as it was until the next login. Put a fixed light over every
area light of the map with SMSG_OVERRIDE_LIGHT, the packet scripted
events use to darken a zone: Light 15377 (daylight) or 16854 (night),
two Forever client lights with a single keyframe that look the same at
any hour. .time auto gives the map its own lights back.

Sent on .time and on every map entry, open world maps only (a dungeon
keeps its own light). A zone's scripted light still wins, and when it
ends, a player with their own sky goes back to it, not to the map's
light. The idea and the two lights come from SIN's Personal Day and
Night pack (0.1.35); written as our own on top of the day cycle.
This commit is contained in:
Karrz1
2026-11-16 19:57:06 +00:00
parent 006493cd98
commit 6f36a6b380
+10
View File
@@ -119,3 +119,13 @@ TEST_CASE("A speed out of range and an unknown saved mode are read safely", "[Cl
CHECK(SkyModeFromDb(2) == SkyMode::Night);
CHECK(SkyModeFromDb(7) == SkyMode::Auto);
}
TEST_CASE(".time day and .time night also put a fixed light over the map, .time auto none", "[ClassicDayCycle]")
{
using namespace DayCycle;
static_assert(OverrideLightFor(SkyMode::Day) == DayLightID);
static_assert(OverrideLightFor(SkyMode::Night) == NightLightID);
static_assert(OverrideLightFor(SkyMode::Auto) == 0);
CHECK(DayLightID != NightLightID);
CHECK(OverrideLightFor(SkyModeFromDb(7)) == 0);
}