标题: nil can't be coerced into fixnum [打印本页] 作者: 靈夢 时间: 2016-5-3 00:07 标题: nil can't be coerced into fixnum 不好意思最近问题真的很多,我测试游戏 一切正常,但是我只要一把用对象是我方hp0的药品用在活人身上,rtab脚本就会出错
出错的部分行数
#------------------------------------------------- -------------------------
# ● ダメージ演算
#------------------------------------------------- -------------------------
def damage_effect(battler, item)
if item == 2
self.hp += self.recover_hp[battler]
self.sp += self.recover_sp[battler]
if self.recover_sp[battler] != 0
self.damage_sp[battler] = -self.recover_sp[battler]
end
else
if self.damage[battler].class != String
self.hp -= self.damage[battler]
end
end
for i in self.state_p[battler]
add_state(i)
end
for i in self.state_m[battler]
remove_state(i)
end
end