Commit b61486ad authored by Mikleo's avatar Mikleo
Browse files

bigfix: removing spawnpoints broke flags.

parent e6036d66
Pipeline #13533 passed with stages
in 14 seconds
......@@ -10,7 +10,7 @@
#include <SteamWorks>
#define PluginVersion "1.47"
#define PluginVersion "1.48"
float pVersion;
// note linearmap field is unstable
......@@ -637,19 +637,29 @@ ExecuteRemoveEntity(int entity)
return;
}
else if(StrEqual(className,"emp_imp_ammo_crate") || StrEqual(className,"emp_nf_ammo_crate") || StrEqual(className,"emp_nf_health_crate") || StrEqual(className,"emp_imp_health_crate") || StrEqual(className,"emp_cap_model",true))
else if(StrEqual(className,"emp_imp_ammo_crate") || StrEqual(className,"emp_nf_ammo_crate") || StrEqual(className,"emp_nf_health_crate") || StrEqual(className,"emp_imp_health_crate") || StrEqual(className,"emp_cap_model",true) || StrEqual(className,"emp_info_player_NF",true) || StrEqual(className,"emp_info_player_Imp",true))
{
// all cap models are inebitably linked. they can only be moved and ignored. same with ammo crates
bool isCapModel = StrEqual(className,"emp_cap_model",true);
if(isCapModel)
{
SetEntProp(entity,Prop_Data,"m_bMapVisible",0);
AcceptEntityInput(entity,"InputNeutral");
}
// important for spawns.
AcceptEntityInput(entity,"InputDisable");
// working with flag entities is a giant pain in the ass
if(isCapModel || FlagExistsAtIndex(GetEntProp(entity,Prop_Data,"m_iCapNumber")))
{
//if is flag or is ammo/health box with cap number
if(isCapModel)
{
SetEntProp(entity,Prop_Data,"m_bMapVisible",0);
AcceptEntityInput(entity,"InputNeutral");
}
// prevent saving.
SetEntProp(entity,Prop_Data,"m_iHammerID",-1);
......@@ -657,16 +667,15 @@ ExecuteRemoveEntity(int entity)
float cornerPosition[3] = {-16000.0,-16000.0,-16000.0};
TeleportEntity(entity,cornerPosition, NULL_VECTOR, NULL_VECTOR);
// set team number to 0, important for spawns to prevent being reenabled.
SetEntProp(entity,Prop_Send,"m_iTeamNum",0);
return;
}
}
else if(StrEqual(className,"emp_info_player_NF",true) || StrEqual(className,"emp_info_player_Imp",true))
{
// disable spawn to remove from spawnpoints.
AcceptEntityInput(entity,"InputDisable");
}
else if(StrEqual(className,"emp_resource_point",true))
{
......@@ -1672,7 +1681,8 @@ LoadEntities(KeyValues kv,float version,int hMin,int hLimit)
// if they are not a custom element just reload them regardless.
if( hammer_id <= hLimit && hammer_id >= hMin)
entity = FindEntityByHammerID(hammer_id,className);
entity = RestoreEntity(entity,kv,classInfo,className);
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "1.47"
"Latest" "1.48"
}
}
......
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