From: <mg...@us...> - 2008-08-18 12:52:06
|
Revision: 2079 http://planeshift.svn.sourceforge.net/planeshift/?rev=2079&view=rev Author: mgist Date: 2008-08-18 12:52:15 +0000 (Mon, 18 Aug 2008) Log Message: ----------- - Merged r2078 from trunk. Modified Paths: -------------- stable/docs/history.txt stable/src/server/combatmanager.cpp Property Changed: ---------------- stable/ Property changes on: stable ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:1911,1915-1916,1918-1919,1923-1927,1930,1934,1936,1939,1941,1945-1949,1951-1953,1958,1960-1961,1964,1966,1968,1970-1972,1974,1978-1979,1981-1982,1986-1988,1990-1991,1994,1996-2001,2003-2004,2008,2019,2023,2026-2031,2037-2038 + /trunk:1911,1915-1916,1918-1919,1923-1927,1930,1934,1936,1939,1941,1945-1949,1951-1953,1958,1960-1961,1964,1966,1968,1970-1972,1974,1978-1979,1981-1982,1986-1988,1990-1991,1994,1996-2001,2003-2004,2008,2019,2023,2026-2031,2037-2038,2078 Modified: stable/docs/history.txt =================================================================== --- stable/docs/history.txt 2008-08-18 12:46:18 UTC (rev 2078) +++ stable/docs/history.txt 2008-08-18 12:52:15 UTC (rev 2079) @@ -1,3 +1,5 @@ +*** 2008-08-15 by Andreas Heinchen +- Added messages in combat manager to see why attacks are stopped *** 2008-08-09 by Steven Patrick - Added the "view stats" permission to GM1, patch by Kerol Modified: stable/src/server/combatmanager.cpp =================================================================== --- stable/src/server/combatmanager.cpp 2008-08-18 12:46:18 UTC (rev 2078) +++ stable/src/server/combatmanager.cpp 2008-08-18 12:52:15 UTC (rev 2079) @@ -734,7 +734,10 @@ bool skipThisRound = false; if (!event->GetAttacker() || !event->GetTarget()) // disconnected and deleted + { + psserver->SendSystemError(event->AttackerCID, "Combat stopped as one participant logged of."); return; + } gemActor *gemAttacker = dynamic_cast<gemActor*> ((gemObject *) event->attacker); gemActor *gemTarget = dynamic_cast<gemActor*> ((gemObject *) event->target); @@ -742,18 +745,35 @@ attacker_data=event->GetAttackerData(); target_data=event->GetTargetData(); - // If the attacker is no longer in attack mode or target is dead, abort. - if (attacker_data->GetMode() != PSCHARACTER_MODE_COMBAT || !gemTarget->IsAlive() ) + // If the attacker is no longer in attack mode abort. + if (attacker_data->GetMode() != PSCHARACTER_MODE_COMBAT) + { + psserver->SendSystemError(event->AttackerCID, + "Combat stopped as you left combat mode."); return; - + } + + // If target is dead, abort. + if (!gemTarget->IsAlive() ) + { + psserver->SendSystemResult(event->AttackerCID, "Combat stopped as one participant logged of."); + return; + } + // If the slot is no longer attackable, abort if (!attacker_data->Inventory().CanItemAttack(event->GetWeaponSlot())) + { + psserver->SendSystemError(event->AttackerCID, "Combat stopped as you have no longer an attackable item equipped."); return; - + } + // If the slot next attack time is not yet up, abort (another event sequence should have been started) if (attacker_data->GetSlotNextAttackTime(event->GetWeaponSlot()) > csGetTicks()) + { + psserver->SendSystemError(event->AttackerCID, "Combat stopped as you have no longer an item to attack equipped."); return; - + } + psItem* weapon = attacker_data->Inventory().GetEffectiveWeaponInSlot(event->GetWeaponSlot()); // weapon became unwieldable @@ -798,14 +818,20 @@ // If the target has changed, abort (assume another combat event has started since we are still in attack mode) if (gemTarget != attacker_client->GetTargetObject()) + { + psserver->SendSystemError(event->AttackerCID, "Target changed."); return; + } } else { // Check if the npc's target has changed (if it has, then assume another combat event has started.) gemNPC* npcAttacker = dynamic_cast<gemNPC*>(gemAttacker); if (npcAttacker && npcAttacker->GetTarget() != gemTarget) + { + psserver->SendSystemError(event->AttackerCID, "NPC's target changed."); return; + } } if (attacker_data->IsSpellCasting()) @@ -907,6 +933,10 @@ // CPrintf(CON_DEBUG, "Queueing Slot %d for %s's next combat event.\n",event->GetWeaponSlot(), event->attacker->GetName() ); QueueNextEvent(event); } + else + { + psserver->SendSystemError(event->AttackerCID, "Item %s is not a auto attack item.",attacker_data->Inventory().GetEffectiveWeaponInSlot(event->GetWeaponSlot())->GetName()); + } // else // CPrintf(CON_DEBUG, "Slot %d for %s not an auto-attack slot.\n",event->GetWeaponSlot(), event->attacker->GetName() ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |