mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 00:46:46 +00:00
Fix for spell target det crash. Also added a command line arg to world ignore_db that lets you ignore the db conversion process for servers that dont need it.
This commit is contained in:
+9
-11
@@ -1467,14 +1467,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
// target required for these
|
||||
case ST_Undead: {
|
||||
if(!spell_target || (
|
||||
spell_target->GetBodyType() != BT_SummonedUndead
|
||||
&& spell_target->GetBodyType() != BT_Undead
|
||||
&& spell_target->GetBodyType() != BT_Vampire
|
||||
mob_body != BT_SummonedUndead
|
||||
&& mob_body != BT_Undead
|
||||
&& mob_body != BT_Vampire
|
||||
)
|
||||
)
|
||||
{
|
||||
//invalid target
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType());
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, mob_body);
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
return false;
|
||||
}
|
||||
@@ -1483,11 +1483,10 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
}
|
||||
|
||||
case ST_Summoned: {
|
||||
uint8 body_type = spell_target?spell_target->GetBodyType():0;
|
||||
if(!spell_target || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3))
|
||||
if(!spell_target || (mob_body != BT_Summoned && mob_body != BT_Summoned2 && mob_body != BT_Summoned3))
|
||||
{
|
||||
//invalid target
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type);
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, mob_body);
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
return false;
|
||||
}
|
||||
@@ -1497,12 +1496,11 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
|
||||
case ST_SummonedPet:
|
||||
{
|
||||
uint8 body_type = spell_target ? spell_target->GetBodyType() : 0;
|
||||
if(!spell_target || (spell_target != GetPet()) ||
|
||||
(body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3 && body_type != BT_Animal))
|
||||
(mob_body != BT_Summoned && mob_body != BT_Summoned2 && mob_body != BT_Summoned3 && mob_body != BT_Animal))
|
||||
{
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)",
|
||||
spell_id, body_type);
|
||||
spell_id, mob_body);
|
||||
|
||||
Message_StringID(13, SPELL_NEED_TAR);
|
||||
|
||||
@@ -1526,7 +1524,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if(!spell_target || mob_body != target_bt)
|
||||
{
|
||||
//invalid target
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt);
|
||||
Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, mob_body, target_bt);
|
||||
if(!spell_target)
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user