The Altera Centauri collection has been brought up to date by Darsnan. It comprises every decent scenario he's been able to find anywhere on the web, going back over 20 years.
25 themes/skins/styles are now available to members. Check the select drop-down at the bottom-left of each page.
Call To Power 2 Cradle 3+ mod in progress: https://apolyton.net/forum/other-games/call-to-power-2/ctp2-creation/9437883-making-cradle-3-fully-compatible-with-the-apolyton-edition
Originally posted by VetLegion
Well the natural way would be array, saving you some calculation and being easier to read and slightly harder to mess up. I have to run, maybe I'll come back to this later and we can discuss your code
Ehrm, writing outside the allocated memory usually means that you are writing in memory management data, so no wonder why you chrash
With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion.
Originally posted by Kuciwalker
It should just segfault though...
Well, that too gives a core dump. Wonder actually what system he is using since I usually get the reason why I get a core dump - that is something more informing than "Aborted (core dumped)".
With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion.
Originally posted by Kuciwalker
It should just segfault though...
No. The way it works is that the C lib for efficiency will allocate a big chunk of memory (one or more pages) at a time, and then give you little peices each time you call malloc.
The malloc implementation is free to use some of its allocated memory for control structures, for example a linked list of allocated memory. For example the elements of this list could be interspersed with the actual malloced memory.
So if you allocate 16 bytes, but write 20 to the pointer you get, you will, say, overwrite the linked list head of the following element in malloc's linked list. So when you call free() it will find an invalid data structure.
For debugging, and depending on the compiler, you can instruct the compiler to link against an alternative malloc implementation which is implemented to discover any corruption sooner.
Comment