Skip to content

Commit 393f8fc

Browse files
committed
Add unstable building pref
1 parent 93d8421 commit 393f8fc

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

GameMode_CityRPG4/server/bricks.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,12 @@ datablock fxDTSBrickData(CityRPGCrimeVehicleData : brickVehicleSpawnData)
401401
%boxSize = %brickSizeX SPC %brickSizeY SPC %brickSizeZ;
402402

403403
%totalTriggerVol = 0;
404+
%triggerCount = 0;
404405
initContainerBoxSearch(%brick.getWorldBoxCenter(), %boxSize, $typeMasks::triggerObjectType);
405406
while(isObject(%trigger = containerSearchNext()))
406407
{
408+
%triggerCount++;
409+
407410
if(%trigger.getDatablock() != CityRPGLotTriggerData.getID()) continue;
408411

409412
// This will assign the first trigger found as the brick's "official" lot for cases where the brick is in the bounds of multiple lots
@@ -433,6 +436,15 @@ datablock fxDTSBrickData(CityRPGCrimeVehicleData : brickVehicleSpawnData)
433436

434437
// Record the clamped volume of the brick based on each trigger
435438
%brickVolClamped[%trigger] = %brickSizeClampedX * %brickSizeClampedY * %brickSizeClampedZ;
439+
440+
// Single-trigger only if unstable building is disabled.
441+
// This needs to be paired with a volume check because placing a brick directly next to a lot (but not actually on it) can still cause that lot to be added to the box search.
442+
if(!$Pref::Server::City::lotReg::unstableBuilding && %triggerCount > 1 && %brickVolClamped[%trigger] > 0)
443+
{
444+
return 1;
445+
}
446+
447+
436448
%totalTriggerVol += %brickVolClamped[%trigger];
437449
}
438450

GameMode_CityRPG4/server/prefs.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ function City_InitPrefs()
6767
City_RegisterPref("Server Management", "Logging Enabled", "$Pref::Server::City::loggerEnabled", "bool", "", true);
6868
City_RegisterPref("Server Management", "Always show hidden chat to admins", "$Pref::Server::City::AdminsAlwaysMonitorChat", "bool", "", false);
6969

70+
City_RegisterPref("Lot Management", "Allow building between lots (warning, can cause issues when selling)", "$Pref::Server::City::lotReg::unstableBuilding", "bool", "", false);
71+
7072
City_RegisterPref("Economy", "Economy Relay", "$Pref::Server::City::Economics::Relay", "int", "0 50", 2);
7173
City_RegisterPref("Economy", "Economy Cap", "$Pref::Server::City::Economics::Cap", "int", "-5000 5000", 150);
7274

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ Dglider for bugfixes and tips, Sentry for replacing missing assets.
6565
* Logging Enabled - Whether to log player actions relating to CityRPG. Logs can be used to assist in moderating your server. Logs are stored in `config\server\CityRPG4_A2\Logs` with one file for player, named by Blockland ID.
6666
* Always show hidden chat to admins - When enabled, admins can spy on "radio" chats for specific job tracks. If disabled, admins will only see these chats while in admin mode.
6767

68+
### Lot Management
69+
* Allow building between lots - When enabled, players can place bricks between their lots. **Beware** that enabling this may cause ownership issues if a player attempts to sell their lot with bricks that connect to another lot. There is currently no way for players to sell a "group" of lots as one.
70+
6871
### Economy
6972
* Economy Relay - How many ticks it takes for the economy value to change.
7073
* Economy Cap - Highest percentage that the economy can reach. Higher economy percentages yield higher paycheck bonuses.

0 commit comments

Comments
 (0)