AI desctructor not called when hosting as spectator

AI desctructor not called when hosting as spectator

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

AI desctructor not called when hosting as spectator

Post by submarine »

I'm not quite sure if this is the case but it seems to me that the destructor of any instance of aai is not called when quitting the game if i hosted as a spectator

however it works normally when hosting as a player. does anyone know why?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Post by Kloot »

I just experimented a bit with rts/ExternalAI/GlobalAI.cpp, and it appears that (at least on Linux) IsCInterface must explicitly be set to false (if _IsCInterface == 0) for ReleaseAI(), and thus by extension your AI's destructor, to be called in CGlobalAI::~CGlobalAI(). I'll submit a patch so that this is done.

edit: submitted
submarine
AI Developer
Posts: 834
Joined: 31 Jan 2005, 20:04

Post by submarine »

that's good, thx very much :)
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

patch committed.
Post Reply

Return to “AI”