Add OnMapInit forward and deprecate OnLevelInit
The change in behaviour to the OnLevelInit forward params isn't obvious when compiling a plugin, deprecate it to make it a lot more obvious that something has changed. Some plugins rely just on the timing of OnLevelInit rather than doing anything with the entity lump, for these plugins offer a new OnMapInit forward that is implemented in core rather than sdkhooks. If / when we offer a new entity lump manipulation API in the future this'll be the forward where it can be used to make changes.
This commit is contained in:
@@ -382,6 +382,7 @@ forward Action OnGetGameDescription(char gameDesc[64]);
|
||||
* @param mapEntities Unused, always empty
|
||||
* @return Unused, return value is ignored
|
||||
*/
|
||||
#pragma deprecated Use OnMapInit() instead
|
||||
forward Action OnLevelInit(const char[] mapName, char mapEntities[2097152]);
|
||||
|
||||
/**
|
||||
|
||||
@@ -182,10 +182,14 @@ forward void OnPluginPauseChange(bool pause);
|
||||
forward void OnGameFrame();
|
||||
|
||||
/**
|
||||
* Called when the map is loaded.
|
||||
* Called when the map starts loading.
|
||||
*
|
||||
* @note This used to be OnServerLoad(), which is now deprecated.
|
||||
* Plugins still using the old forward will work.
|
||||
* @param mapName Name of the map
|
||||
*/
|
||||
forward void OnMapInit(const char[] mapName);
|
||||
|
||||
/**
|
||||
* Called when the map is loaded.
|
||||
*/
|
||||
forward void OnMapStart();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user