Commit 404e9c79 authored by Mikleo's avatar Mikleo

Fixed baseswap bugs introduced in previous version.

parent 48cc3440
Pipeline #10892 passed with stages
in 14 seconds
......@@ -10,7 +10,7 @@
#include <SteamWorks>
#define PluginVersion "1.22"
#define PluginVersion "1.23"
float pVersion;
// note linearmap field is unstable
......@@ -4138,6 +4138,7 @@ bool LoadScenario(int client,char[] filename)
float version = kv.GetFloat("version");
LoadCvars(kv);
int hLimit = kv.GetNum("hLimit",BASEHAMMERID -1 );
kv.JumpToKey("Entities");
......@@ -4685,6 +4686,8 @@ RestoreEntity(int entity,KeyValues kv,any[] classInfo ,char[] className)
entity = CreateEntityByName(className);
}
}
if(entity == -1)
......@@ -5973,12 +5976,19 @@ SwitchFactionString(char[] rString,int rStringSize)
ReplaceString(rString, rStringSize, "/Imperial/", "/NF/", true);
}
if(ReplaceString(rString, rStringSize, "nf", "imp", true) == 0)
{
ReplaceString(rString, rStringSize, "imp", "nf", true);
}
bool foundTeam = false;
if(ReplaceString(rString, rStringSize, "_nf", "_imp", true) > 0)
foundTeam = true;
if(ReplaceString(rString, rStringSize, "nf_", "imp_", true) > 0)
foundTeam = true;
if(foundTeam)
return;
return false;
ReplaceString(rString, rStringSize, "_imp", "_nf", true);
ReplaceString(rString, rStringSize, "imp_", "nf_", true);
return;
}
......@@ -6000,10 +6010,8 @@ int SwitchFaction(int entity,char[] classname)
SwitchFactionString(classname,64);
any classInfo[classdataenum];
// don't switch flag entities for now. And only do cap entities with no cap number.
// don't reload ref points
// don't swap ammo boxes on flag for now until we can fix issues with existing flags. i.e. homeland crashes.
if(GetEntitySavingKeys(classname,pVersion,classInfo) && ShouldSave(entity,classname,classInfo) && classInfo[data_group] != 2 && (classInfo[data_group] !=1 || !FlagExistsAtIndex(GetEntProp(entity,Prop_Data,"m_iCapNumber"))))
// only swap buildings and spawn and ammo boxes not associated with flags
if(GetEntitySavingKeys(classname,pVersion,classInfo) && ShouldSave(entity,classname,classInfo) && (classInfo[data_group] == 5 || classInfo[data_group] == 3 || (classInfo[data_group] ==1 && !FlagExistsAtIndex(GetEntProp(entity,Prop_Data,"m_iCapNumber"))) ))
{
......
......@@ -1211,6 +1211,7 @@
"emp_comm_restrict"
{
"extend" "brush"
"customOnly" "1"
"version" "1.04"
"moveable" "0"
}
......@@ -1218,6 +1219,7 @@
{
"extend" "brush"
"version" "1.04"
"customOnly" "1"
"moveable" "0"
"fields"
{
......@@ -1251,6 +1253,7 @@
"extend" "entity"
"version" "1.08"
"moveable" "0"
"removable" "false"
"fields"
{
"skin"
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "1.22"
"Latest" "1.23"
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment