Fixed issue with determining a valid location.

This commit is contained in:
Cekis
2018-03-23 16:03:01 -07:00
committed by CekisSWG
parent 5bf67c75d5
commit b8187b7b5f
9 changed files with 16 additions and 11 deletions
@@ -254,14 +254,14 @@ public class combat_base extends script.base_script
atkRslt.weapon = weaponData.id;
atkRslt.actionName = getStringCrc(toLower(actionName));
atkRslt.useLocation = true;
if(isValidLocation(targetLoc,1f)) {
if(targetLoc != null && isValidLocation(targetLoc)) {
atkRslt.targetLocation = new vector(targetLoc.x, targetLoc.y, targetLoc.z);
atkRslt.targetCell = targetLoc.cell;
}
else {
location tl = getLocation(target);
if(!isValidLocation(tl, 1f)){
LOG("heroics","IG-88 could not identify the target's (" + target + ":" + getPlayerFullName(target) + ") location (" + targetLoc.toString() + ") to attack it.");
if(!isValidLocation(tl)){
LOG("combat","Could not identify the target's (" + target + ":" + getPlayerFullName(target) + ") location (" + targetLoc + ") to attack it.");
}
atkRslt.targetLocation = new vector(tl.x, tl.y, tl.z);
atkRslt.targetCell = tl.cell;
@@ -896,7 +896,7 @@ public class combat_base extends script.base_script
{
if (weaponData.weaponType == WEAPON_TYPE_DIRECTIONAL)
{
if(actionData != null && isValidLocation(actionData.targetLoc, 1f)) {
if(actionData != null && isValidLocation(actionData.targetLoc)) {
defenders = pvpGetTargetsInCone(self, self, actionData.targetLoc, length, width);
}
else{