Kaynağa Gözat

preserve the long spell save by using the trigger on timer

Emagi 1 yıl önce
ebeveyn
işleme
3f34a0f3b1
1 değiştirilmiş dosya ile 17 ekleme ve 0 silme
  1. 17 0
      EQ2/source/WorldServer/client.cpp

+ 17 - 0
EQ2/source/WorldServer/client.cpp

@@ -11408,6 +11408,23 @@ void Client::TriggerSpellSave()
 		save_spell_state_time_bucket = 0;
 		save_spell_state_timer.Start(interval, true);
 	}
+	
+	else
+	{
+		int32 elapsed_time = save_spell_state_timer.GetElapsedTime();
+		save_spell_state_time_bucket += elapsed_time;
+
+		int32 save_wait_cap = rule_manager.GetGlobalRule(R_Spells, PlayerSpellSaveStateCap)->GetInt32();
+		
+		// default to not have some bogus value in the rule
+		if(save_wait_cap < interval)
+			save_wait_cap = interval+1;
+		
+		if(save_spell_state_time_bucket >= save_wait_cap)
+		{
+			save_spell_state_timer.Trigger();
+		}
+	}
 	MSaveSpellStateMutex.unlock();
 }