diff --git a/Missionframework/KPLIB_debriefs.hpp b/Missionframework/KPLIB_debriefs.hpp
new file mode 100644
index 000000000..0a00492f8
--- /dev/null
+++ b/Missionframework/KPLIB_debriefs.hpp
@@ -0,0 +1,10 @@
+class CfgDebriefing
+{
+ class KPLIB_Win
+ {
+ title = $STR_DEBRIEF_WINTITLE;
+ subtitle = "";
+ description = $STR_DEBRIEF_WINDESCR;
+ pictureBackground = "";
+ };
+};
diff --git a/Missionframework/description.ext b/Missionframework/description.ext
index 8c44bb336..8ae051dba 100644
--- a/Missionframework/description.ext
+++ b/Missionframework/description.ext
@@ -48,3 +48,4 @@ minPlayerDistance = 1000;
#include "KPLIB_params.hpp"
#include "KPLIB_functions.hpp"
#include "KPLIB_ui.hpp"
+#include "KPLIB_debriefs.hpp"
diff --git a/Missionframework/modules/00_init/fnc/fn_init_save.sqf b/Missionframework/modules/00_init/fnc/fn_init_save.sqf
index 16562cc4a..916a560c6 100644
--- a/Missionframework/modules/00_init/fnc/fn_init_save.sqf
+++ b/Missionframework/modules/00_init/fnc/fn_init_save.sqf
@@ -17,6 +17,8 @@
BOOL
*/
+if (!KPLIB_campaignRunning) exitWith {false};
+
if (KPLIB_param_debugSave > 0) then {diag_log format ["[KP LIBERATION] [SAVE] ----- Time: %1 - Save function started -----", diag_tickTime];};
// Call the save data fetch functions from each module and store them in a multidimensional array for saving
diff --git a/Missionframework/modules/01_core/fnc/fn_core_changeSectorOwner.sqf b/Missionframework/modules/01_core/fnc/fn_core_changeSectorOwner.sqf
index e177b39b2..69908ebb0 100644
--- a/Missionframework/modules/01_core/fnc/fn_core_changeSectorOwner.sqf
+++ b/Missionframework/modules/01_core/fnc/fn_core_changeSectorOwner.sqf
@@ -22,6 +22,7 @@ params ["_sectorToChange", ["_toPlayerSide", true]];
if (_toPlayerSide) then {
KPLIB_sectors_blufor pushBack _sectorToChange;
+ call KPLIB_fnc_core_checkWinCond;
} else {
KPLIB_sectors_blufor = KPLIB_sectors_blufor - [_sectorToChange];
};
diff --git a/Missionframework/modules/01_core/fnc/fn_core_checkWinCond.sqf b/Missionframework/modules/01_core/fnc/fn_core_checkWinCond.sqf
new file mode 100644
index 000000000..bdcd58431
--- /dev/null
+++ b/Missionframework/modules/01_core/fnc/fn_core_checkWinCond.sqf
@@ -0,0 +1,27 @@
+/*
+ KPLIB_fnc_core_checkWinCond
+
+ File: fn_core_checkWinCond.sqf
+ Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
+ Date: 2018-05-10
+ Last Update: 2018-05-10
+ License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
+
+ Description:
+ Checks if the selected win conditions are met and end the mission.
+
+ Parameter(s):
+ NONE
+
+ Returns:
+ BOOL
+*/
+
+// In the next steps we'll implement a parameter for more win conditions. For now the "old one" will be used.
+if (({_x in KPLIB_sectors_blufor} count KPLIB_sectors_metropolis) == count KPLIB_sectors_metropolis) then {
+ KPLIB_campaignRunning = false;
+ call KPLIB_fnc_init_wipe;
+ "KPLIB_win" call BIS_fnc_endMissionServer;
+};
+
+true
diff --git a/Missionframework/modules/01_core/fnc/fn_core_updateSectorMarkers.sqf b/Missionframework/modules/01_core/fnc/fn_core_updateSectorMarkers.sqf
index 7324243a6..03777e3c1 100644
--- a/Missionframework/modules/01_core/fnc/fn_core_updateSectorMarkers.sqf
+++ b/Missionframework/modules/01_core/fnc/fn_core_updateSectorMarkers.sqf
@@ -27,8 +27,12 @@
if ((_x select 1) in KPLIB_sectors_blufor) then {
(_x select 0) setMarkerColor KPLIB_preset_colorPlayers;
} else {
- (_x select 0) setMarkerColor KPLIB_preset_colorEnemy;
- }
+ if ((_x select 1) in KPLIB_sectors_active) then {
+ (_x select 0) setMarkerColor KPLIB_preset_colorEnemyAct;
+ } else {
+ (_x select 0) setMarkerColor KPLIB_preset_colorEnemy;
+ };
+ };
} forEach KPLIB_sectors_lockedVehMarkers;
true
diff --git a/Missionframework/modules/01_core/functions.hpp b/Missionframework/modules/01_core/functions.hpp
index dbbe8633a..51e8cdbf5 100644
--- a/Missionframework/modules/01_core/functions.hpp
+++ b/Missionframework/modules/01_core/functions.hpp
@@ -23,6 +23,9 @@ class core {
// Check player gear against blacklist
class core_checkGear {};
+ // Check if win conditions are met
+ class core_checkWinCond {};
+
// The intro cinematic procedure
class core_cinematic {};
diff --git a/Missionframework/stringtable.xml b/Missionframework/stringtable.xml
index 3f1174b14..f0556ea1e 100644
--- a/Missionframework/stringtable.xml
+++ b/Missionframework/stringtable.xml
@@ -1220,6 +1220,15 @@
Canlan
Mobilizar
+
+
+ The area is liberated.
+ Das Gebiet wurde befreit.
+
+
+ Later you'll have a cinematic with the stats etc.
+ Später wird hier eine Sequenz mit den Statistiken etc. laufen.
+
%1 minutes mobile respawn cooldown left.