Archived
1

Fix error, when user tries to print it's profile without weapon

This commit is contained in:
Vladimir Hodakov 2018-02-20 22:58:13 +04:00
parent 6a681669ab
commit 48679e85eb

View File

@ -165,7 +165,11 @@ func (u *Users) ProfileMessage(update *tgbotapi.Update, playerRaw *dbmapping.Pla
message += "\n💲" + c.Statistics.GetPrintablePoints(profileRaw.Wealth) message += "\n💲" + c.Statistics.GetPrintablePoints(profileRaw.Wealth)
message += " |💎" + strconv.Itoa(profileRaw.Crystalls) message += " |💎" + strconv.Itoa(profileRaw.Crystalls)
message += " |⭕" + strconv.Itoa(profileRaw.Pokeballs) message += " |⭕" + strconv.Itoa(profileRaw.Pokeballs)
if weapon != nil {
message += "\n⚔Атака: " + c.Statistics.GetPrintablePoints(weapon.Power) + " + " + c.Statistics.GetPrintablePoints(attackPokememes) + "\n" message += "\n⚔Атака: " + c.Statistics.GetPrintablePoints(weapon.Power) + " + " + c.Statistics.GetPrintablePoints(attackPokememes) + "\n"
} else {
message += "\n⚔Атака: " + c.Statistics.GetPrintablePoints(attackPokememes) + "\n"
}
if profileRaw.WeaponID != 0 { if profileRaw.WeaponID != 0 {
message += "\n🔫Оружие: " + weapon.Name + " " + c.Statistics.GetPrintablePoints(weapon.Power) + "⚔" message += "\n🔫Оружие: " + weapon.Name + " " + c.Statistics.GetPrintablePoints(weapon.Power) + "⚔"