mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[Time] strict spawn_events now take into account EQ minute. (#1370)
* strict spawn_events now take into account EQ minute. This should fixed the eqtime spawn condition from falling behind. * change a log to logspawns and add a comment in ExecEvent function. * moved the comment to the note paramenter in the rule for last commit.
This commit is contained in:
parent
b61cc85b5f
commit
ebdb8e5d90
@ -269,6 +269,7 @@ RULE_BOOL(Zone, EnableZoneControllerGlobals, false, "Enables the ability to use
|
||||
RULE_INT(Zone, GlobalLootMultiplier, 1, "Sets Global Loot drop multiplier for database based drops, useful for double, triple loot etc")
|
||||
RULE_BOOL(Zone, KillProcessOnDynamicShutdown, true, "When process has booted a zone and has hit its zone shut down timer, it will hard kill the process to free memory back to the OS")
|
||||
RULE_INT(Zone, SecondsBeforeIdle, 60, "Seconds before IDLE_WHEN_EMPTY define kicks in")
|
||||
RULE_INT(Zone, SpawnEventMin, 3, "When strict is set in spawn_events, specifies the max EQ minutes into the trigger hour a spawn_event will fire. Going below 3 may cause the spawn_event to not fire.")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Map)
|
||||
|
||||
@ -832,8 +832,11 @@ void SpawnConditionManager::Process() {
|
||||
if(EQTime::IsTimeBefore(&tod, &cevent.next)) {
|
||||
//this event has been triggered.
|
||||
//execute the event
|
||||
if(!cevent.strict || (cevent.strict && cevent.next.hour == tod.hour && cevent.next.day == tod.day && cevent.next.month == tod.month && cevent.next.year == tod.year))
|
||||
uint8 min = cevent.next.minute + RuleI(Zone, SpawnEventMin);
|
||||
if(!cevent.strict || (cevent.strict && tod.minute < min && cevent.next.hour == tod.hour && cevent.next.day == tod.day && cevent.next.month == tod.month && cevent.next.year == tod.year))
|
||||
ExecEvent(cevent, true);
|
||||
else
|
||||
LogSpawns("Event {}: Is strict, ExecEvent is skipped.", cevent.id);
|
||||
|
||||
//add the period of the event to the trigger time
|
||||
EQTime::AddMinutes(cevent.period, &cevent.next);
|
||||
@ -858,6 +861,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) {
|
||||
std::map<uint16, SpawnCondition>::iterator condi;
|
||||
condi = spawn_conditions.find(event.condition_id);
|
||||
if(condi == spawn_conditions.end()) {
|
||||
//If we're here, strict has already been checked. Check again in case hour has changed.
|
||||
LogSpawns("Event [{}]: Unable to find condition [{}] to execute on", event.id, event.condition_id);
|
||||
return; //unable to find the spawn condition to operate on
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user