Issue850

Title Freedroid Bet Bartender Issue
Priority 0.16 rc bugs Status rejected
Assigned To Keywords
Linked issues Watchers

Submitted on 2016-01-26 19h38 by sydneyjd, last changed by fluzz.

Messages
Author: sydneyjd Date: 2016-01-26   19h38
Hello All,
Im running Freedroid 0.16rc2-14-g3281067_mod (latest arch "stable")
I was making an bet with the bartender and when i won a dice rolling game i was 
greeted directly by the "chose a multiplier" screen. THis is the output.
Im not sure if this is related to the other bug i reported and was fixed or not.
--------------------------------------------------------------------------------
-
FreedroidRPG 0.16rc2-14-g3281067_mod encountered a problem in function: 
resume_lua_coroutine
Error running Lua code: /usr/local/share/freedroidrpg/dialogs/Ewald.lua:418: bad 
argument #1 to 'add_gold' (number has no integer representation).
Erroneous LuaCode={
403  		code = function()
404  			Npc:says(_"You've bet %d valuable circuits.", bet)
405  			ewd1,ewd2,ewd3 = 
math.random(1,6),math.random(1,6),math.random(1,6)
406  			Npc:says(_"My rolls are %d, %d and %d.", ewd1, ewd2, 
ewd3)
407  			tux2,tux3 = math.random(1,6),math.random(1,6)
408  			Tux:says(_"I rolled a %d and a %d.", tux2, tux3)
409  
410  			Npc:says(_"It looks like I scored %d and you scored 
%d.", ewd1 + ewd2 + ewd3, tux1 + tux2 + tux3)
411  
412  			if ((ewd1+ewd2+ewd3) < (tux1+tux2+tux3)) then --Tux 
wins!
413  				Npc:says_random(_"You won! Good job.",
414  								_"You won! Man 
you are lucky!",
415  								_"You won!")
416  				local bet_gain = {easy = 0.95, normal = 0.85, 
hard = 0.8}
417  				bet = bet * bet_gain[difficulty()]
>418 				Tux:add_gold(bet)
419  				total_bet = total_bet + bet
420  				--; TRANSLATORS: %d = amount of valuable 
circuits
421  				display_console_message(string.format(_"You won 
%d valuable circuits by gambling dice with Ewald.", math.floor(bet)))
422  			else -- House Wins!
423  				Npc:says_random(_"You lost. Bad luck.",
424  								_"You lost. 
Better luck next time.",
425  								_"You lost, try 
again?",
426  								_"You lost. 
Maybe you might like coin-flipping better?")
427  				Tux:del_gold(bet)
428  				total_bet = total_bet - bet
429  				--; TRANSLATORS: %d = amount of valuable 
circuits
430  				display_console_message(string.format(_"You lost 
%d valuable circuits by gambling dice with Ewald.", bet))
431  			end
432  			hide("node41", "node42", "node43") next("node60")
433  		end,
}


Hopefully this helps!
-Sydney
Author: fluzz Date: 2016-01-27   10h54
This has already been fixed in commit c3f81ec3, which is included in 0.16
History
Date User Action Args
2016-01-27 10:54:48fluzzsetstatus: open -> rejected
messages: + msg3303
2016-01-26 19:38:38sydneyjdcreate