[svn] Lightning breath causes error and repeats - Death

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
MisiuPysiu
Archmage
Posts: 379
Joined: Tue Nov 11, 2003 10:54 am
Location: Wroclaw/Poland

[svn] Lightning breath causes error and repeats - Death

#1 Post by MisiuPysiu »

Hey,

I noticed, every time a multi-hued wyrm or a lightning wyrm breaths lightning an error comes up:
Error
Error
tome-1.0.1-1366272852.jpg (196.56 KiB) Viewed 806 times
After this the breath is cast again, causing additional damage and the error message shows up again.
After a few circles of this bug my char is dead:
tome-1.0.1-1366272868.jpg
tome-1.0.1-1366272868.jpg (207.01 KiB) Viewed 806 times
Cheers

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: [svn] Lightning breath causes error and repeats - Death

#2 Post by Hachem_Muche »

This is caused by a missing default parameter for lightning daze damage type. Fix:

Code: Select all

Index: game/modules/tome/data/damage_types.lua
===================================================================
--- game/modules/tome/data/damage_types.lua	(revision 6619)
+++ game/modules/tome/data/damage_types.lua	(working copy)
@@ -1056,6 +1056,7 @@
 	name = "lightning daze", type = "LIGHTNING_DAZE", text_color = "#ROYAL_BLUE#",
 	projector = function(src, x, y, type, dam)
 		if _G.type(dam) == "number" then dam = {dam=dam, daze=25} end
+		dam.daze = dam.daze or 25
 		local realdam = DamageType:get(DamageType.LIGHTNING).projector(src, x, y, DamageType.LIGHTNING, dam.dam)
 		local target = game.level.map(x, y, Map.ACTOR)
 		if target and dam.daze > 0 and rng.percent(dam.daze) then
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

MisiuPysiu
Archmage
Posts: 379
Joined: Tue Nov 11, 2003 10:54 am
Location: Wroclaw/Poland

Re: [svn] Lightning breath causes error and repeats - Death

#3 Post by MisiuPysiu »

Great!

Works very well now.
Thanks a lot!

Post Reply