Guild icon
Teeworlds
discord.gg/teeworlds / general
Teeworlds Discord Server.
Between 2018-07-18 00:00:00Z and 2018-07-19 00:00:00Z
Avatar
[quakenet] <nameless_tee17> hi, can someone spare 5 minutes to help me with a small programming problem related to teeworlds? I dont think that is much of a big deal but Im not that familiar with c++ after all
15:40
[quakenet] <heinrich5991> post the problem
15:43
[quakenet] <nameless_tee17> I subclassed the "player" class. Now I do want to add an instance of this subclass to the m_apPlayers array in the gamecontext.cpp as follows m_apPlayers[ClientID] = new(ClientID) CBotPlayer(this, ClientID, StartTeam); Now since I didnt do anything with the MACRO_ALLOC_POOL_ID() macros in the subclass, everytime this line is called I raise the "size assertion error" from the entity.h. I dont know how to deal with the pools in o
15:44
[quakenet] <nameless_tee17> in the players array
15:45
[quakenet] <heinrich5991> unfortunately, subclassing that way is incompatible with the storage pools
15:45
[quakenet] <heinrich5991> as they assume a fixed size for every element
15:45
[quakenet] <heinrich5991> oh wait, you also did this in the subclass. mh...
15:46
[quakenet] <nameless_tee17> first I tried to add the same macros in the subclass as well, ye, but it didnt work because dbg_assert(ms_PoolUsed##POOLTYPE[id], "not used"); was raised then
15:47
[quakenet] <heinrich5991> ah. well
15:47
[quakenet] <heinrich5991> the easiest way out would probably be to resort to dynamic allocation
15:49
[quakenet] <heinrich5991> (I actually don't know how defining operator new() interacts with subclassing)
15:50
[quakenet] <nameless_tee17> mh...
15:53
[quakenet] <nameless_tee17> I added you as a skype friend just now, maybe we can talk in german to resolve this super quick. if you dont have time, its fine as well
Meltingchocolate joined the server. 2018-07-18 19:20:59Z
Exported 14 message(s)