mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-25 17:12:52 +01:00
prevent crash when not in guild on logout
This commit is contained in:
@@ -116,8 +116,8 @@ func handleMsgMhfAcquireGuildTresure(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
|
|
||||||
func treasureHuntUnregister(s *Session) {
|
func treasureHuntUnregister(s *Session) {
|
||||||
guild, err := GetGuildInfoByCharacterId(s, s.charID)
|
guild, err := GetGuildInfoByCharacterId(s, s.charID)
|
||||||
if err != nil {
|
if err != nil || guild == nil {
|
||||||
panic(err)
|
return
|
||||||
}
|
}
|
||||||
var huntID int
|
var huntID int
|
||||||
var hunters string
|
var hunters string
|
||||||
@@ -125,10 +125,7 @@ func treasureHuntUnregister(s *Session) {
|
|||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
rows.Scan(&huntID, &hunters)
|
rows.Scan(&huntID, &hunters)
|
||||||
hunters = stringsupport.CSVRemove(hunters, int(s.charID))
|
hunters = stringsupport.CSVRemove(hunters, int(s.charID))
|
||||||
_, err = s.server.db.Exec("UPDATE guild_hunts SET hunters=$1 WHERE id=$2", hunters, huntID)
|
s.server.db.Exec("UPDATE guild_hunts SET hunters=$1 WHERE id=$2", hunters, huntID)
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user