← Back to team overview

widelands-dev team mailing list archive

Re: send_player_* commands

 

> is it possible to know that previous send_player_* command was processed
> yet? 

send_player_command returns void, so I don't think so.


> My AI can send these commands every 5 seconds, and it seems that first
> one is not executed and AI (not knowing this) sends another command.
> Then first one is executed, state of ship is changed and second one
> crashes the game, because f.e. ship is not in 'expedition' mode anymore.
> At least this might be one explanation of what is going on.

Can you query the state of the ship? The ship has a get_task function
which might do the trick.

Failing this, the ship sends messages to the player when a coast has
been reached etc, maybe you can add a notification there like we did for
the mines. And you coud try to track if it has moved around the map.


Follow ups

References