-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from gruppe-adler/various-bugfixes
various bugfixes & clean ups
- Loading branch information
Showing
12 changed files
with
50 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
addons/legacy/functions/fnc_sm_activities_state_surrendered_enter.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 7 additions & 9 deletions
16
addons/legacy/functions/fnc_sm_lifecycle_trans_life_despawn_condition.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
#include "..\script_component.hpp" | ||
|
||
private _idx = GVAR(localCivs) find _this; | ||
if (CBA_missionTime - (_this getVariable [QGVAR(lastDespawnCheck), 0]) < 10) exitWith {}; | ||
_this setVariable [QGVAR(lastDespawnCheck), CBA_missionTime]; | ||
|
||
if (_idx == -1) exitWith {false}; // should not happen, really | ||
|
||
if (((floor CBA_missionTime) mod 10) != (_idx mod 10)) exitWith {false}; // check only every 10s for a given unit | ||
LOG_1("check despawn cond for %1", _this); | ||
|
||
if (_this getVariable ["grad_civs_excludeFromCleanup",false]) exitWith {false}; | ||
|
||
scopeName "main"; | ||
|
||
private _type = _this getVariable ["grad_civs_primaryTask", ""]; | ||
private _civTaskTypeInfo = EGVAR(common,civTaskTypes) getVariable [_type, []]; | ||
_civTaskTypeInfo params [ | ||
["_cleanupDistance", 99999, [0]], | ||
["_despawnCondition", {false}, [{}]] | ||
]; | ||
|
||
private _tooDistantFromPlayers = false; | ||
if ((count ALL_HUMAN_PLAYERS > 0) || ([QGVAR(spawnOnlyWithPlayers)] call CBA_settings_fnc_get)) then { | ||
if ([ALL_HUMAN_PLAYERS, getPos _this, _cleanupDistance] call FUNC(isInDistanceFromOtherPlayers)) then { | ||
INFO("despawning civ based on distance"); | ||
breakOut "main"; | ||
INFO_1("despawning civ %1 based on distance", _this); | ||
_tooDistantFromPlayers = true; | ||
}; | ||
} else { | ||
INFO("no human players connected, but civs allowed - will abstain from despawning civilians based on player distance"); | ||
}; | ||
|
||
_this call _despawnCondition | ||
_tooDistantFromPlayers || {_this call _despawnCondition} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
addons/voyage/functions/fnc_sm_business_state_voyage_enter.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
addons/voyage/functions/fnc_sm_business_state_voyage_loop.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters