Преглед на файлове

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

Emagi преди 2 години
родител
ревизия
9f51f8bdd0
променени са 3 файла, в които са добавени 15 реда и са изтрити 8 реда
  1. 11 4
      EQ2/source/WorldServer/SpellProcess.cpp
  2. 1 1
      EQ2/source/WorldServer/SpellProcess.h
  3. 3 3
      EQ2/source/common/version.h

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

@@ -831,6 +831,7 @@ bool SpellProcess::AddDissonance(LuaSpell* spell) {
 
 
 void SpellProcess::AddSpellToQueue(Spell* spell, Entity* caster){
 void SpellProcess::AddSpellToQueue(Spell* spell, Entity* caster){
 	if(caster && caster->IsPlayer() && spell){
 	if(caster && caster->IsPlayer() && spell){
+		LogWrite(SPELL__DEBUG, 1, "Spell", "%s AddSpellToQueue casting %s.", caster->GetName(), spell->GetName());
 		spell_que.Put(caster, spell);
 		spell_que.Put(caster, spell);
 		((Player*)caster)->QueueSpell(spell);
 		((Player*)caster)->QueueSpell(spell);
 		Client* client = caster->GetZone()->GetClientBySpawn(caster);
 		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){
 	if(caster && caster->IsPlayer() && spell){
+		LogWrite(SPELL__DEBUG, 1, "Spell", "%s RemoveSpellFromQueue casting %s.", caster->GetName(), spell->GetName());
 		spell_que.erase(caster);
 		spell_que.erase(caster);
 		((Player*)caster)->UnQueueSpell(spell);
 		((Player*)caster)->UnQueueSpell(spell);
 		Client* client = caster->GetZone()->GetClientBySpawn(caster);
 		Client* client = caster->GetZone()->GetClientBySpawn(caster);
-		if(client)
+		if(client && send_update)
 			SendSpellBookUpdate(client);
 			SendSpellBookUpdate(client);
 	}
 	}
 }
 }
@@ -857,6 +859,8 @@ void SpellProcess::RemoveSpellFromQueue(Entity* caster, bool hostile_only) {
 			if (hostile_only && spell->GetSpellData()->target_type != SPELL_TARGET_ENEMY)
 			if (hostile_only && spell->GetSpellData()->target_type != SPELL_TARGET_ENEMY)
 				remove = false;
 				remove = false;
 			if (remove) {
 			if (remove) {
+				
+				LogWrite(SPELL__DEBUG, 1, "Spell", "%s RemoveSpellFromQueue::Secondary casting %s.", caster->GetName(), spell->GetName());
 				spell_que.erase(caster);
 				spell_que.erase(caster);
 				((Player*)caster)->UnQueueSpell(spell);
 				((Player*)caster)->UnQueueSpell(spell);
 				Client* client = caster->GetZone()->GetClientBySpawn(caster);
 				Client* client = caster->GetZone()->GetClientBySpawn(caster);
@@ -878,13 +882,16 @@ bool SpellProcess::CheckSpellQueue(Spell* spell, Entity* caster){
 	if(caster->IsPlayer()){
 	if(caster->IsPlayer()){
 		bool add = true;
 		bool add = true;
 		bool remove = false;
 		bool remove = false;
+		Spell* prevSpell = 0;
 		if(spell_que.count(caster) > 0){
 		if(spell_que.count(caster) > 0){
+			prevSpell = spell_que.Get(caster);
 			remove = true;
 			remove = true;
-			if(spell_que.Get(caster) == spell)
+			if(prevSpell == spell) {
 				add = false;
 				add = false;
+			}
 		}
 		}
 		if(remove)
 		if(remove)
-			RemoveSpellFromQueue(spell, caster);
+			RemoveSpellFromQueue(prevSpell, caster, !add);
 		if(add)
 		if(add)
 		{
 		{
 			AddSpellToQueue(spell, caster);		
 			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>
 	/// <summary>Removes a spell from the queue for the player</summary>
 	/// <param name='spell'>Spell to remove from the queue</param>
 	/// <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>
 	/// <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>
 	/// <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>
 	/// <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
 #endif
 
 
 #if defined(LOGIN)
 #if defined(LOGIN)
-#define CURRENT_VERSION	"0.9.4-aquarii"
+#define CURRENT_VERSION	"0.9.5-epsiloncma"
 #elif defined(WORLD)
 #elif defined(WORLD)
-#define CURRENT_VERSION	"0.9.4-aquarii"
+#define CURRENT_VERSION	"0.9.5-epsiloncma"
 #else
 #else
-#define CURRENT_VERSION	"0.9.4-aquarii"
+#define CURRENT_VERSION	"0.9.5-epsiloncma"
 #endif
 #endif
 
 
 #define COMPILE_DATE	__DATE__
 #define COMPILE_DATE	__DATE__