Actions: (WIP) Add locks, unlocks and re-execution of actions if there are interruptions. Need to improve the lock/unlock mechanism.

Dialogues, trading: Add lock and unlock upon starting/finishing an interaction.
Updated README with progress.
Pathfinding: Fix slight bug that avoid a map being generated if the difference of start and end positions' z coordinate is zero.
This commit is contained in:
zorman2000
2017-01-18 19:34:02 -05:00
parent e265bc283e
commit 60b847a02a
5 changed files with 169 additions and 37 deletions

View File

@ -258,11 +258,15 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
if fields then
local player_response = npc.trade.results.single_trade_offer[player_name]
-- Unlock the action timer
npc.unlock_actions(player_response.npc)
if fields.yes_option then
npc.trade.perform_trade(player_response.npc, player_name, player_response.trade_offer)
elseif fields.no_option then
minetest.chat_send_player(player_name, "Talk to me if you change your mind!")
end
end
end