fix(guild): fix poogie outfit unlock calculation

Cherry-picked from main (7459ded) with conflict resolution.
The original fix changed the poogie outfit unlock from incorrect
math.Pow calculation to direct value assignment.

Also removes unused math import (531b3d2).
This commit is contained in:
Houmgaor
2026-01-30 01:02:18 +01:00
parent 982393daf4
commit 355c2c01cc

View File

@@ -8,7 +8,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"math"
"sort" "sort"
"strings" "strings"
"time" "time"
@@ -733,8 +732,7 @@ func handleMsgMhfOperateGuild(s *Session, p mhfpacket.MHFPacket) {
case mhfpacket.OPERATE_GUILD_CHANGE_PUGI_3: case mhfpacket.OPERATE_GUILD_CHANGE_PUGI_3:
handleChangePugi(s, uint8(pkt.Data1.ReadUint32()), guild, 3) handleChangePugi(s, uint8(pkt.Data1.ReadUint32()), guild, 3)
case mhfpacket.OPERATE_GUILD_UNLOCK_OUTFIT: case mhfpacket.OPERATE_GUILD_UNLOCK_OUTFIT:
// TODO: This doesn't implement blocking, if someone unlocked the same outfit at the same time s.server.db.Exec(`UPDATE guilds SET pugi_outfits=$1 WHERE id=$2`, pkt.Data1.ReadUint32(), guild.ID)
s.server.db.Exec(`UPDATE guilds SET pugi_outfits=pugi_outfits+$1 WHERE id=$2`, int(math.Pow(float64(pkt.Data1.ReadUint32()), 2)), guild.ID)
case mhfpacket.OPERATE_GUILD_DONATE_EVENT: case mhfpacket.OPERATE_GUILD_DONATE_EVENT:
quantity := uint16(pkt.Data1.ReadUint32()) quantity := uint16(pkt.Data1.ReadUint32())
bf.WriteBytes(handleDonateRP(s, quantity, guild, true)) bf.WriteBytes(handleDonateRP(s, quantity, guild, true))