mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
Refactor grantParts function to remove unnecessary parts existence check
This commit is contained in:
@@ -289,12 +289,6 @@ func (h *QuestHandler) grantCompanion(user *store.UserState, companionId int32,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *QuestHandler) grantParts(user *store.UserState, partsId int32, nowMillis int64) {
|
func (h *QuestHandler) grantParts(user *store.UserState, partsId int32, nowMillis int64) {
|
||||||
for _, row := range user.Parts {
|
|
||||||
if row.PartsId == partsId {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var mainStatId int32
|
var mainStatId int32
|
||||||
if partsDef, ok := h.PartsById[partsId]; ok {
|
if partsDef, ok := h.PartsById[partsId]; ok {
|
||||||
mainStatId = h.DefaultPartsStatusMainByLotteryGroup[partsDef.PartsStatusMainLotteryGroupId]
|
mainStatId = h.DefaultPartsStatusMainByLotteryGroup[partsDef.PartsStatusMainLotteryGroupId]
|
||||||
|
|||||||
Reference in New Issue
Block a user