Use the blank-attack image instead of no image at all (in attack dialog).

I suppose it looks better.  It's a simple fix for the problem of using
an invalid file.  This also fix the error message in the standard
ouput spotted in bug #9570
This commit is contained in:
Ali El Gariani 2007-07-25 16:53:10 +00:00
parent 81c7cb763f
commit 3695a0de78

View file

@ -61,8 +61,12 @@ attack_type::attack_type(const config& cfg,const std::string& id, const std::str
type_ = cfg["type"];
icon_ = cfg["icon"];
if(icon_.empty())
icon_ = "attacks/" + id_ + ".png";
if(icon_.empty()){
if (id_ != "")
icon_ = "attacks/" + id_ + ".png";
else
icon_ = "attacks/blank-attack.png";
}
range_ = cfg["range"].value();
damage_ = atol(cfg["damage"].c_str());