Exile_64bit_Conversion/Overrides/ExileServer_object_construction_database_insert.sqf
Declan Ireland 9afa3a4225 Some Fixes for NULL
Just some fixes for NULL for extDB3 (since it is now supported properly
when doing prepared statements).

Reverted createTerritory to passing flag_stolen_by_uid to an input
value.
Just incase there is a 3rd party code that uses this, possible used by
admin tools to restore base without a flag etc...
2017-02-23 16:49:48 +00:00

39 lines
1.5 KiB
Plaintext

/**
* ExileServer_object_construction_database_insert
*
* Exile Mod
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
private["_constructionObject","_position","_vectorDirection","_vectorUp","_territoryFlag","_territoryID","_data","_extDB2Message","_constructionID"];
_constructionObject = _this;
_position = getPosATL _constructionObject;
_vectorDirection = vectorDir _constructionObject;
_vectorUp = vectorUp _constructionObject;
_territoryFlag = _constructionObject call ExileClient_util_world_getTerritoryAtPosition;
_territoryID = if (isNull _territoryFlag) then { '' } else { _territoryFlag getVariable ["ExileDatabaseID", '']};
_data =
[
typeOf _constructionObject,
_constructionObject getVariable ["ExileOwnerUID", ""],
_position select 0,
_position select 1,
_position select 2,
_vectorDirection select 0,
_vectorDirection select 1,
_vectorDirection select 2,
_vectorUp select 0,
_vectorUp select 1,
_vectorUp select 2,
_territoryID
];
_extDB2Message = ["insertConstruction", _data] call ExileServer_util_extDB2_createMessage;
_constructionID = _extDB2Message call ExileServer_system_database_query_insertSingle;
_constructionObject setVariable ["ExileDatabaseID", _constructionID];
_constructionObject setVariable ["ExileTerritoryID", _territoryID];
_constructionID