[LUA][Rulesets] Tile reval signal

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
Lachu
Elite
Posts: 472
Joined: Sat May 04, 2013 2:19 pm

[LUA][Rulesets] Tile reval signal

Post by Lachu »

I know, that making good Civilization scenario is hard and adding signals invoked once player reveal some tile/city/hero on map doesn't change this, but maybe this little change could be useful?
"Sir, We've discovered barbarian camp! Raze it!" ;-)
User avatar
dunnoob
Elite
Posts: 327
Joined: Mon Dec 23, 2013 3:13 am
Location: Hamburg
Contact:

Re: [LUA][Rulesets] Tile reval signal

Post by dunnoob »

There is a unit_moved signal, and I never tested or used it so far. Allegedly a handler gets arguments (Unit unit, Tile src_tile, Tile dst_tile), and if that happens after the move all adjacent tiles for the destination including huts, enemies, etc. should be visible.

Out of curiosity I just tried to find it in the code, it's in server/unittools.c near line 3935 deep in function unit_move(). Near the end, vision already updated, after is applicable. IOW, what you want should be possible in Lua, it's just a special case of "unit_moved".

Edit: comment added on the Wiki.
Post Reply