This commit is contained in:
Treeku
2014-04-10 10:22:07 +01:00
6 changed files with 39 additions and 8 deletions
@@ -838,7 +838,7 @@ public class PlayerObject extends IntangibleObject {
public boolean deductLots(int amount)
{
if(this.lotsRemaining - amount > 0)
if(this.lotsRemaining - amount >= 0)
{
this.lotsRemaining -= amount;
return true;
+1 -1
View File
@@ -57,7 +57,7 @@ public class HouseTemplate
public boolean canBePlacedOn(String planetName)
{
if(placeablePlanets.contains(planetName)) return true;
else return false;
return false;
}
public int getLotCost()
{
+1 -2
View File
@@ -97,12 +97,11 @@ public class HousingService implements INetworkDispatch {
}
// Lot stuff
if(actor.getPlayerObject().getLotsRemaining() - structureLotCost < 0)
if(!actor.getPlayerObject().deductLots(structureLotCost))
{
actor.sendSystemMessage("You do not have enough available lots to place this structure.", (byte) 0); // should probably load this from an stf
return;
}
actor.getPlayerObject().deductLots(structureLotCost);
// Calculate our orientation and height
Quaternion quaternion = new Quaternion(1, 0, 0, 0);
+10
View File
@@ -82,6 +82,16 @@ public class SUIService implements INetworkDispatch {
if(target == null || owner == null)
return;
if(target.getGrandparent() != null && target.getGrandparent().getAttachment("structureAdmins") != null)
{
if(core.housingService.getPermissions(owner, target.getContainer()))
{
core.scriptService.callScript("scripts/radial/", "moveable", "createRadial", core, owner, target, request.getRadialOptions());
sendRadial(owner, target, request.getRadialOptions(), request.getRadialCount());
return;
}
}
core.scriptService.callScript("scripts/radial/", getRadialFilename(target), "createRadial", core, owner, target, request.getRadialOptions());
if(getRadialFilename(target).equals("default"))
return;