there might be another problem: directly below the last element of that array, there is another pointer to something else meaning the moment you overwrite that the game crashes as it is something with collision
schmeling65
so even if we do 0x32 -> 0x33+ we will be overwriting pointers to other stuff
pegperegogaucho
It depends if it the array is stored on the heap or in static memory
schmeling65
eh... malloc of an object which has the array?
pegperegogaucho
Yes, malloc of the array or an object with the array
pegperegogaucho
At least with the Avoidance stuff (which caused a crash with more than 50 enemies) was dynamically allocated (At least I think so long time ago)
schmeling65
heal in that case
schmeling65
atleast bing is saying malloc in C does dynamic heap
pegperegogaucho
So you could justs change the size which was allocated i.e. malloc(200) -> malloc(2000)
schmeling65
but hmm...
```
In programming, memory allocation can occur in different areas depending on the type of data and its usage. Here’s a brief overview:
Heap Memory
Dynamic Allocation: Memory is allocated during the execution of a program, typically using functions like malloc in C or new in C++/Java.
Objects and Data Structures: Used for objects and data structures that need to persist beyond the scope of a single function or method.
Manual Management: Requires explicit allocation and deallocation by the programmer, which can lead to memory leaks if not handled properly12.
Static Memory
Global and Static Variables: Memory for global variables and static variables is allocated at compile time and persists for the lifetime of the program.
Fixed Size: The size of static memory is determined at compile time and does not change during execution.
Automatic Management: The memory is automatically managed by the compiler, so there’s no need for manual allocation or deallocation12.
Would you like to dive deeper into any specific aspect of memory allocation?
```
schmeling65
isn't the array static then?
pegperegogaucho
Again, it depends on how it is programmed
schmeling65
well heso said its static
pegperegogaucho
It could be
static ProjectileNode projectiles[50]; -> static
or something like
ProjectileNode* projectiles = new ProjectileNode[50]; -> dynamic
pegperegogaucho
And if it is static, the array would be stored in the executable
pegperegogaucho
and then that is more complicated to change
pegperegogaucho
ELB making a nightmare for modders again
pegperegogaucho
Also, there was another limit on the number of shadows too