Merge branch 'SWG-Source:master' into master

This commit is contained in:
Heron
2022-03-25 19:29:24 -05:00
committed by GitHub
5 changed files with 18 additions and 8 deletions
@@ -22090,6 +22090,16 @@ public class base_class
{
return _getAccountNumLots(getLongWithNull(player));
}
/**
* Get the maximum housing lots a character can have
* @return The number of lots has available to them.
*/
private static native int _getMaxHousingLots();
public static int getMaxHousingLots()
{
return _getMaxHousingLots();
}
/**
* Find out what game features this player has purchased
* @param player The player (creature object)
@@ -116,7 +116,6 @@ public class player_structure extends script.base_script
public static final float RATE_POWER_MIN = 1.0f;
public static final float MERCHANT_SALES_MODIFIER = -0.2f;
public static final int MIN_RESIDENCE_DURATION = 86400;
public static final int MAX_LOTS = 10;
public static final int MAX_LIST_SIZE = 50;
public static final int MAIL_WARNING_INTERVAL = 86400;
public static final int TIME_TO_NEXT_PACKUP = 86400;
@@ -815,7 +814,7 @@ public class player_structure extends script.base_script
struct_lots = 1;
}
flagConverted(template, structure);
if ((getAccountNumLots(getPlayerObject(player)) + struct_lots) > MAX_LOTS)
if ((getAccountNumLots(getPlayerObject(player)) + struct_lots) > getMaxHousingLots())
{
String realStructureTemplate = template;
if (exists(structure))
@@ -1167,12 +1166,13 @@ public class player_structure extends script.base_script
{
lots_needed = 1;
}
if (lots > MAX_LOTS)
int max_lots = getMaxHousingLots();
if (lots > max_lots)
{
sendSystemMessageProse(player, prose.getPackage(new string_id(STF_FILE, "not_enough_lots"), lots_needed));
return false;
}
if ((lots + lots_needed) > MAX_LOTS)
if ((lots + lots_needed) > max_lots)
{
if (!allowOverLotLimitIfPlayerHouse || (template.indexOf("object/building/player/player_house_") != 0)) {
sendSystemMessageProse(player, prose.getPackage(new string_id(STF_FILE, "not_enough_lots"), lots_needed));
@@ -703,7 +703,7 @@ public class live_conversions extends script.base_script
}
public void updateLotOverLimitStructureLocation(obj_id player) throws InterruptedException
{
if (getAccountNumLots(getPlayerObject(player)) <= player_structure.MAX_LOTS)
if (getAccountNumLots(getPlayerObject(player)) <= getMaxHousingLots())
{
removeObjVar(player, "lotOverlimit");
}
@@ -1845,7 +1845,7 @@ public class player_building extends script.base_script
return SCRIPT_CONTINUE;
}
}
if ((perm_switch == 3) && (getAccountNumLots(getPlayerObject(self)) > player_structure.MAX_LOTS))
if ((perm_switch == 3) && (getAccountNumLots(getPlayerObject(self)) > getMaxHousingLots()))
{
obj_id lotOverlimitStructure = getObjIdObjVar(self, "lotOverlimit.structure_id");
if (isIdValid(lotOverlimitStructure) && (lotOverlimitStructure == structure))
@@ -4831,7 +4831,7 @@ public class player_building extends script.base_script
public int OnConstructionComplete(obj_id self, dictionary params) throws InterruptedException
{
string_id structure_name = params.getStringId("structure_name");
int lots_remaining = player_structure.MAX_LOTS - getAccountNumLots(getPlayerObject(self));
int lots_remaining = getMaxHousingLots() - getAccountNumLots(getPlayerObject(self));
prose_package pp_msg = new prose_package();
pp_msg.stringId = ((lots_remaining >= 0) ? SID_CONSTRUCTION_COMPLETE : SID_CONSTRUCTION_COMPLETE_LOT_LIMIT_EXCEEDED);
pp_msg.actor.set(self);
@@ -150,7 +150,7 @@ public class vendor_control_device extends script.base_script
sendSystemMessage(player, SID_ONLY_IN_HOUSES);
return SCRIPT_CONTINUE;
}
if (getAccountNumLots(getPlayerObject(player)) > player_structure.MAX_LOTS)
if (getAccountNumLots(getPlayerObject(player)) > getMaxHousingLots())
{
obj_id lotOverlimitStructure = getObjIdObjVar(player, "lotOverlimit.structure_id");
if (isIdValid(lotOverlimitStructure) && (lotOverlimitStructure != structure))