Skip to content

Commit 09b9509

Browse files
author
Cre8or
committed
Added backwards compabitility for player-built houses
- Player-built houses from existing savegames will now be saved with their "OT_house_isPlayerBuilt" set to true
1 parent 9cde307 commit 09b9509

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

addons/overthrow_main/functions/save/fn_loadGame.sqf

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ private _cc = 0;
2828

2929
sleep 0.3;
3030

31+
3132
//now do everything else
33+
private _buildableHouses = [];
34+
private _hasList_buildableHouses = false;
3235
{
3336
_x params ["_key","_val"];
3437

@@ -198,9 +201,17 @@ sleep 0.3;
198201
};
199202
};
200203

204+
// Fetch the list of buildable houses
205+
if (!_hasList_buildableHouses) then {
206+
if (!isNil "OT_Buildables") then {
207+
_buildableHouses = (OT_Buildables param [9, []]) param [2, []];
208+
_hasList_buildableHouses = true;
209+
};
210+
};
211+
201212
// If the object is a player-built house, fetch its variables
202213
private _houseParams = _x param [8, []];
203-
if !(_houseParams isEqualTo []) then {
214+
if (!(_houseParams isEqualTo []) or {_type in _buildableHouses}) then {
204215
_veh setVariable ["OT_house_isPlayerBuilt", true, true];
205216

206217
private _isLeased = _houseParams param [0, false];

0 commit comments

Comments
 (0)