Difference between revisions of "S PreserveEnts"

From Valve Developer Community
Jump to: navigation, search
(Updated tf2)
(l4d2 s_PreserveEnts; added "Code Dumps" section)
Line 1: Line 1:
 
{{stub}}
 
{{stub}}
 
{{DISPLAYTITLE:s_PreserveEnts}}
 
{{DISPLAYTITLE:s_PreserveEnts}}
In multiplayer Source games, when a round is reset in some way, all entities are deleted and then respawned to quickly reset the map. However, a list of entities to ''not'' reset exists. Usually these entities have special code to handle the resetting process. The {{ent|player}} entity for example, should not ever be erased unless the client disconnects from the server.
+
In multiplayer Source games, during a round reset, all entities are resetted by being deleted then quickly respawned, unless they are under a whitelist. Usually these entities have special code to handle the resetting process, or isn't ideal to be. The{{ent|player}}entity for example, should not ever be erased unless the client disconnects from the server.
  
 
Some entities in this list however, do not have any code for handling round resets, so when the reset occurs, those entities will behave in unwanted ways as they have carried over all their properties (including position) from the last round.
 
Some entities in this list however, do not have any code for handling round resets, so when the reset occurs, those entities will behave in unwanted ways as they have carried over all their properties (including position) from the last round.
Line 20: Line 20:
 
||N/A
 
||N/A
 
||{{style|color:yellow|Unsure}}
 
||{{style|color:yellow|Unsure}}
||{{style|color:yellow|Unsure}}
+
||{{style|color:orange|From code dump}}
 
||{{style|color:green|Yes}}
 
||{{style|color:green|Yes}}
 
||{{style|color:yellow|Unsure}}
 
||{{style|color:yellow|Unsure}}
Line 26: Line 26:
 
|}
 
|}
  
=={{hl2}}hl2mp/hl2mp_gamerules.cpp==
+
== Source Code ==
<pre>
+
==={{hl2}}hl2mp/hl2mp_gamerules.cpp===
 +
{{ExpandBox|
 +
<syntaxhighlight lang="cpp">
 
static const char *s_PreserveEnts[] =
 
static const char *s_PreserveEnts[] =
 
{
 
{
Line 70: Line 72:
 
"", // END Marker
 
"", // END Marker
 
};
 
};
</pre>
+
</syntaxhighlight>
 +
}}
  
=={{portal}}portal/portal_mp_gamerules.cpp==
+
==={{portal}}portal/portal_mp_gamerules.cpp===
<pre>
+
{{ExpandBox|
 +
<syntaxhighlight lang="cpp">
 
static const char *s_PreserveEnts[] =
 
static const char *s_PreserveEnts[] =
 
{
 
{
Line 116: Line 120:
 
"", // END Marker
 
"", // END Marker
 
};
 
};
</pre>
+
</syntaxhighlight>
 +
}}
  
=={{tf2}}tf/tf_gamerules.cpp==
+
==={{tf2}}tf/tf_gamerules.cpp===
<pre>
+
{{ExpandBox|
 +
<syntaxhighlight lang="cpp">
 
static const char *s_PreserveEnts[] =
 
static const char *s_PreserveEnts[] =
 
{
 
{
Line 186: Line 192:
 
"", // END Marker
 
"", // END Marker
 
};
 
};
</pre>
+
</syntaxhighlight>
 +
}}
  
=={{css}}cstrike/cs_gamerules.cpp==
+
==={{css}}cstrike/cs_gamerules.cpp===
<pre>
+
{{ExpandBox|
 +
<syntaxhighlight lang="cpp">
 
static const char *s_PreserveEnts[] =
 
static const char *s_PreserveEnts[] =
 
{
 
{
Line 233: Line 241:
 
"", // END Marker
 
"", // END Marker
 
};
 
};
</pre>
+
</syntaxhighlight>
=={{csgo}}cstrike15/cs_gamerules.cpp==
+
}}
<pre>
+
 
 +
==={{csgo}}cstrike15/cs_gamerules.cpp===
 +
{{ExpandBox|
 +
<syntaxhighlight lang="cpp">
 
static const char *s_PreserveEnts[] =
 
static const char *s_PreserveEnts[] =
 
{
 
{
Line 297: Line 308:
 
"", // END Marker
 
"", // END Marker
 
};
 
};
</pre>
+
</syntaxhighlight>
 +
}}
  
=={{dods}}dod/dod_gamerules.cpp==
+
==={{dods}}dod/dod_gamerules.cpp===
<pre>
+
{{ExpandBox|
 +
<syntaxhighlight lang="cpp">
 
static const char *s_PreserveEnts[] =
 
static const char *s_PreserveEnts[] =
 
{
 
{
Line 342: Line 355:
 
"", // END Marker
 
"", // END Marker
 
};
 
};
</pre>
+
</syntaxhighlight>
 +
}}
  
=={{as}}swarm/asw_gamerules.cpp==
+
==={{as}}swarm/asw_gamerules.cpp===
<pre>
+
{{ExpandBox|
 +
<syntaxhighlight lang="cpp">
 
CAlienSwarm::CAlienSwarm()
 
CAlienSwarm::CAlienSwarm()
 
{
 
{
Line 361: Line 376:
 
m_MapResetFilter.AddKeepEntity("ai_network");
 
m_MapResetFilter.AddKeepEntity("ai_network");
 
}
 
}
 +
</syntaxhighlight>
 +
}}
 +
 +
== Code Dumps ==
 +
=== {{l4d2}} Left 4 Dead 2 ===
 +
21/07/2021 - Address<code>107A8D64</code>is to be jumped to.
 +
{{ExpandBox|
 +
<pre>
 +
* ai_network,
 +
* ai_hint,
 +
* cs_team_manager,
 +
* terror_gamerules,
 +
* terror_player_manager,
 +
* survivor_bot,
 +
* env_tonemap_controller,
 +
* env_tonemap_controller_infected,
 +
* env_tonemap_controller_ghost,
 +
* vote_controller,
 +
* env_soundscape,
 +
* env_soundscape_proxy,
 +
* env_soundscape_triggerable,
 +
* env_sun,
 +
* env_wind,
 +
* env_fog_controller,
 +
* func_wall,
 +
* infodecal,
 +
* info_projecteddecal,
 +
* info_node,
 +
* info_node_hint,
 +
* info_map_parameters,
 +
* info_map_parameters_versus,
 +
* info_ladder,
 +
* func_simpleladder,
 +
* player,
 +
* point_viewcontrol,
 +
* scene_manager,
 +
* shadow_control,
 +
* sky_camera,
 +
* soundent,
 +
* trigger_soundscape,
 +
* viewmodel,
 +
* predicted_viewmodel,
 +
* worldspawn,
 +
* point_devshot_camera,
 +
* weapon_scavenge_item_spawn,
 +
* logic_versus_random,
 
</pre>
 
</pre>
 +
}}

Revision as of 04:18, 21 July 2021

In multiplayer Source games, during a round reset, all entities are resetted by being deleted then quickly respawned, unless they are under a whitelist. Usually these entities have special code to handle the resetting process, or isn't ideal to be. Theplayerentity for example, should not ever be erased unless the client disconnects from the server.

Some entities in this list however, do not have any code for handling round resets, so when the reset occurs, those entities will behave in unwanted ways as they have carried over all their properties (including position) from the last round.

To do: Attempt to finish this table. Some games might not have any way to reset the round (even through mp_forcewin or mp_restartgame).

Alien Swarm Counter-Strike: Global Offensive Counter-Strike: Source Day of Defeat: Source Half-Life 2 HL2:DM HL2:Ep1 HL2:Ep2 Left 4 Dead Left 4 Dead 2 Portal Portal 2 Team Fortress 2
Affects: Yes Yes Yes Yes N/A Yes N/A N/A Unsure From code dump Yes Unsure Yes

Source Code

Half-Life 2hl2mp/hl2mp_gamerules.cpp



Portalportal/portal_mp_gamerules.cpp



Team Fortress 2tf/tf_gamerules.cpp



Counter-Strike: Sourcecstrike/cs_gamerules.cpp



Counter-Strike: Global Offensivecstrike15/cs_gamerules.cpp



Day of Defeat: Sourcedod/dod_gamerules.cpp



Alien Swarmswarm/asw_gamerules.cpp



Code Dumps

Left 4 Dead 2 Left 4 Dead 2

21/07/2021 - Address107A8D64is to be jumped to.