URL: <http://gna.org/patch/?4011>
Summary: Lua: edit.change_terrain and edit.place_resource Project: Freeciv Submitted by: gorb Submitted on: Wed 17 Jul 2013 10:46:27 AM GMT Category: general Priority: 5 - Normal Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: _______________________________________________________ Details: Add two new lua functions in module edit: edit.change_terrain, change terrain edit.place_resource I've tested with: function map_labels() local terrain = find.tile(170,230) edit.change_terrain(terrain, 'Mountains') local terrain = find.tile(170,230) edit.place_resource(terrain, 'Gold') end function turn_cb(turn, year) if turn == 0 then map_labels() end end Works, the result is a transformation from deep ocean to mountain, with a resource (gold), but there are messages. Only change function: in begin_turn() [srv_main.c::881]: assertion 'cont > 0' failed. ( 170, 230) at "Mountains" in begin_phase() [srv_main.c::948]: assertion 'cont > 0' failed. ( 170, 230) at "Mountains" Both functions (change and place): in begin_phase() [srv_main.c::948]: assertion 'cont > 0' failed. ( 170, 230) at "Mountains" _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Wed 17 Jul 2013 10:46:27 AM GMT Name: change_terrain_and_place_resource.diff Size: 3kB By: gorb <http://gna.org/patch/download.php?file_id=18310> _______________________________________________________ Reply to this item at: <http://gna.org/patch/?4011> _______________________________________________ Message sent via/by Gna! http://gna.org/ _______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev