Browse Source

Fix #468 glow queue fix and version update to 0.9.5 EpsilonCMa

Emagi 1 year ago
parent
commit
9f51f8bdd0

+ 11 - 4
EQ2/source/WorldServer/SpellProcess.cpp

@@ -831,6 +831,7 @@ bool SpellProcess::AddDissonance(LuaSpell* spell) {
 
 void SpellProcess::AddSpellToQueue(Spell* spell, Entity* caster){
 	if(caster && caster->IsPlayer() && spell){
+		LogWrite(SPELL__DEBUG, 1, "Spell", "%s AddSpellToQueue casting %s.", caster->GetName(), spell->GetName());
 		spell_que.Put(caster, spell);
 		((Player*)caster)->QueueSpell(spell);
 		Client* client = caster->GetZone()->GetClientBySpawn(caster);
@@ -839,12 +840,13 @@ void SpellProcess::AddSpellToQueue(Spell* spell, Entity* caster){
 	}
 }
 
-void SpellProcess::RemoveSpellFromQueue(Spell* spell, Entity* caster){
+void SpellProcess::RemoveSpellFromQueue(Spell* spell, Entity* caster, bool send_update){
 	if(caster && caster->IsPlayer() && spell){
+		LogWrite(SPELL__DEBUG, 1, "Spell", "%s RemoveSpellFromQueue casting %s.", caster->GetName(), spell->GetName());
 		spell_que.erase(caster);
 		((Player*)caster)->UnQueueSpell(spell);
 		Client* client = caster->GetZone()->GetClientBySpawn(caster);
-		if(client)
+		if(client && send_update)
 			SendSpellBookUpdate(client);
 	}
 }
@@ -857,6 +859,8 @@ void SpellProcess::RemoveSpellFromQueue(Entity* caster, bool hostile_only) {
 			if (hostile_only && spell->GetSpellData()->target_type != SPELL_TARGET_ENEMY)
 				remove = false;
 			if (remove) {
+				
+				LogWrite(SPELL__DEBUG, 1, "Spell", "%s RemoveSpellFromQueue::Secondary casting %s.", caster->GetName(), spell->GetName());
 				spell_que.erase(caster);
 				((Player*)caster)->UnQueueSpell(spell);
 				Client* client = caster->GetZone()->GetClientBySpawn(caster);
@@ -878,13 +882,16 @@ bool SpellProcess::CheckSpellQueue(Spell* spell, Entity* caster){
 	if(caster->IsPlayer()){
 		bool add = true;
 		bool remove = false;
+		Spell* prevSpell = 0;
 		if(spell_que.count(caster) > 0){
+			prevSpell = spell_que.Get(caster);
 			remove = true;
-			if(spell_que.Get(caster) == spell)
+			if(prevSpell == spell) {
 				add = false;
+			}
 		}
 		if(remove)
-			RemoveSpellFromQueue(spell, caster);
+			RemoveSpellFromQueue(prevSpell, caster, !add);
 		if(add)
 		{
 			AddSpellToQueue(spell, caster);		

+ 1 - 1
EQ2/source/WorldServer/SpellProcess.h

@@ -288,7 +288,7 @@ public:
 	/// <summary>Removes a spell from the queue for the player</summary>
 	/// <param name='spell'>Spell to remove from the queue</param>
 	/// <param name='caster'>Entity's queue to remove the spell from, if not a player function does nothing</param>
-	void RemoveSpellFromQueue(Spell* spell, Entity* caster);
+	void RemoveSpellFromQueue(Spell* spell, Entity* caster, bool send_update = true);
 
 	/// <summary>Clear the queue, or clear only hostile spells from the queue</summary>
 	/// <param name='caster'>Entity to clear the queue for, if not player function does nothing</param>

+ 3 - 3
EQ2/source/common/version.h

@@ -38,11 +38,11 @@
 #endif
 
 #if defined(LOGIN)
-#define CURRENT_VERSION	"0.9.4-aquarii"
+#define CURRENT_VERSION	"0.9.5-epsiloncma"
 #elif defined(WORLD)
-#define CURRENT_VERSION	"0.9.4-aquarii"
+#define CURRENT_VERSION	"0.9.5-epsiloncma"
 #else
-#define CURRENT_VERSION	"0.9.4-aquarii"
+#define CURRENT_VERSION	"0.9.5-epsiloncma"
 #endif
 
 #define COMPILE_DATE	__DATE__