1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-26 06:28:30 +02:00
VVVVVV/desktop_version/src
Misa 4f881b9e26 Fix enemy movement types 10/12 causing memory leaks
If spawned as a custom enemy (createentity entry 56), or spawned outside
of the rooms they spawn in in the main game, they will repeatedly clone
themselves every frame, which profusely leaks memory. In fact it quickly
causes a crash in 2.2 and previous, but 2.3 fixes that crash, so it just
keeps spawning enemies endlessly, which eventually lags the game, and
eventually can out-of-memory your system (bad!).

The problem is those movement types rely on entclass::setenemyroom() to
change their `behave` to be 11 or 13. Else, the new entity created will
still have `behave` 10 or 12, which will create ANOTHER entity in the
same way, and so on, and so forth.

So to fix this, just make it so if an enemy is still `behave` 10 or 12
by the end, then, just set it to -1. That way it'll stay still and won't
cause any harm.

I considered setting the `behave` to 11 or 13 respectively, but, that's
probably going farther than just fixing a memory leak, and anyways, it's
not that much useful for me as a custom level maker, and the entities
spawned aren't really controllable.
2021-08-19 16:50:44 -07:00
..
BinaryBlob.cpp Abstract binary blob loading to FileSystemUtils 2021-04-13 10:02:40 -04:00
BinaryBlob.h Abstract binary blob loading to FileSystemUtils 2021-04-13 10:02:40 -04:00
BlockV.cpp Remove unused x and y attributes of blockclass 2021-02-27 18:27:28 -05:00
BlockV.h Remove unused x and y attributes of blockclass 2021-02-27 18:27:28 -05:00
Credits.h Update Credits.h 2021-08-13 20:36:09 -04:00
DeferCallbacks.c Add deferred callbacks to game loop 2021-03-21 02:55:42 -04:00
DeferCallbacks.h Add deferred callbacks to game loop 2021-03-21 02:55:42 -04:00
editor.cpp Fix regression with platv values not parsed as 2.2-and-prev 2021-08-18 19:19:33 -07:00
editor.h Refactor room properties to use setter and getter funcs 2021-03-24 15:55:34 -04:00
Ent.cpp Fix regression: quick stopping changing drawframe 2021-07-28 20:11:16 -04:00
Ent.h Fix regression: quick stopping changing drawframe 2021-07-28 20:11:16 -04:00
Entity.cpp Fix enemy movement types 10/12 causing memory leaks 2021-08-19 16:50:44 -07:00
Entity.h Fix regression: quick stopping changing drawframe 2021-07-28 20:11:16 -04:00
Enums.h Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00
Exit.h Add VVV_exit() 2021-02-15 23:07:35 -05:00
FileSystemUtils.cpp Wrap level dir enumerate callback pointer in struct 2021-08-19 00:48:05 -07:00
FileSystemUtils.h Add option to delete all custom level save data 2021-08-18 16:02:11 -07:00
Finalclass.cpp Separate includes into sections and alphabetize them 2020-07-19 21:37:40 -04:00
Finalclass.h Remove unnecessary includes from header files 2020-07-19 21:37:40 -04:00
Game.cpp Add option to delete all custom level save data 2021-08-18 16:02:11 -07:00
Game.h Add option to delete all custom level save data 2021-08-18 16:02:11 -07:00
GlitchrunnerMode.c Split glitchrunner mode into multiple versions 2021-08-05 13:35:21 -04:00
GlitchrunnerMode.h Split glitchrunner mode into multiple versions 2021-08-05 13:35:21 -04:00
GOGNetwork.c Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Graphics.cpp Remove level menu rendering code in NO_CUSTOM_LEVELS builds 2021-08-18 09:26:14 -07:00
Graphics.h Do not close game if custom level has assets issues 2021-08-10 16:33:52 -04:00
GraphicsResources.cpp Add asserts for missing images and sound effects 2021-04-18 15:01:43 -04:00
GraphicsResources.h Consistently use angle brackets for SDL.h includes 2020-07-19 21:37:40 -04:00
GraphicsUtil.cpp Remove unnecessary Sint16 casts 2021-04-18 14:55:33 -04:00
GraphicsUtil.h Add ClearSurface() 2021-02-25 19:38:25 -05:00
Input.cpp Add option to delete all custom level save data 2021-08-18 16:02:11 -07:00
Input.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
KeyPoll.cpp Fix regression with regaining focus resuming music 2021-08-18 20:50:02 -07:00
KeyPoll.h Separate pressing Enter to open map from pressing Enter to interact 2021-05-19 00:04:00 -07:00
Labclass.cpp Separate includes into sections and alphabetize them 2020-07-19 21:37:40 -04:00
Labclass.h Remove unnecessary includes from header files 2020-07-19 21:37:40 -04:00
Logic.cpp Split glitchrunner mode into multiple versions 2021-08-05 13:35:21 -04:00
Logic.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
main.cpp Do not close game if custom level has assets issues 2021-08-10 16:33:52 -04:00
MakeAndPlay.h Use multiline comments in C files 2021-04-17 00:50:04 -04:00
Map.cpp Disable final color animations if screen effects off 2021-08-07 19:22:00 -04:00
Map.h Fix cycling title BG more than once per frame 2021-08-05 21:42:59 -04:00
Maths.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Music.cpp Music: Enforce the quick fade time as soon as we know it's happening. 2021-06-14 15:11:39 -04:00
Music.h Fix fade volume durations being incorrect 2021-04-27 20:33:44 -04:00
Network.c Factor out UNUSED macro to header file 2021-05-25 15:23:34 -04:00
Network.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Otherlevel.cpp Bounds check all entity getters that can return 0 2020-09-25 13:51:47 -04:00
Otherlevel.h Remove unnecessary includes from header files 2020-07-19 21:37:40 -04:00
preloader.cpp Change all surface-clearing FillRect()s to use ClearSurface() 2021-02-25 19:38:25 -05:00
preloader.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Render.cpp Add option to delete all custom level save data 2021-08-18 16:02:11 -07:00
Render.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
RenderFixed.cpp Remove game.gametimer in favor of game.frames 2021-03-21 20:53:11 -04:00
RenderFixed.h Remove now-unneeded deltaframe fix when going to in-game settings 2021-03-21 02:55:42 -04:00
Screen.cpp Move graphic options menu update to toggleFullScreen 2021-04-22 19:42:32 -04:00
Screen.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
ScreenSettings.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Script.cpp tokenize(): Check all arguments 2021-08-12 23:47:03 -04:00
Script.h createentity command: Actually have p1/p2/p3/p4 defaults 2021-08-12 00:20:40 -04:00
Scripts.cpp Don't restart music in trinket cutscenes 2021-04-12 16:17:31 -04:00
SoundSystem.cpp Add asserts for missing images and sound effects 2021-04-18 15:01:43 -04:00
SoundSystem.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Spacestation2.cpp Separate includes into sections and alphabetize them 2020-07-19 21:37:40 -04:00
Spacestation2.h Remove unnecessary includes from header files 2020-07-19 21:37:40 -04:00
SteamNetwork.c Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
TerminalScripts.cpp Revert "Change final stretch song to Piercing the Sky" 2021-05-20 23:01:43 -04:00
Textbox.cpp Don't update crewmate colors in text boxes every deltaframe 2021-05-18 21:17:06 -04:00
Textbox.h Don't update crewmate colors in text boxes every deltaframe 2021-05-18 21:17:06 -04:00
ThirdPartyDeps.c Use multiline comments in C files 2021-04-17 00:50:04 -04:00
Tower.cpp Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Tower.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
TowerBG.h Move mapclass r/g/b variables off onto TowerBG 2021-01-07 21:15:34 -05:00
Unused.h Factor out UNUSED macro to header file 2021-05-25 15:23:34 -04:00
UtilityClass.cpp Factor out "between" calculation to macro and func 2021-05-25 15:23:34 -04:00
UtilityClass.h Do not close game if custom level has assets issues 2021-08-10 16:33:52 -04:00
Version.h Don't recompile all files when the commit hash is changed 2020-12-25 20:17:01 -05:00
Version.h.in Don't recompile all files when the commit hash is changed 2020-12-25 20:17:01 -05:00
WarpClass.cpp Separate includes into sections and alphabetize them 2020-07-19 21:37:40 -04:00
WarpClass.h Remove unnecessary includes from header files 2020-07-19 21:37:40 -04:00
XMLUtils.cpp Move all settings to settings.vvv 2020-11-04 12:06:57 -05:00
XMLUtils.h Move all settings to settings.vvv 2020-11-04 12:06:57 -05:00