赛跑活动

This commit is contained in:
hahwu 2025-04-02 17:20:45 +08:00
parent 56d3b6d53a
commit 993b1b20b7
2 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ func GetCoin(Id int) int {
}
func GetExtraReward(Id int) []*item.Item {
data, err := gamedata.GetDataByIntKey(CFG_RACE_TEMPLATE, Id)
data, err := gamedata.GetDataByIntKey(CFG_RACE_PASS, Id)
if err != nil {
return nil
}
@ -70,7 +70,7 @@ func GetExtraReward(Id int) []*item.Item {
}
func GetReward(Id int) []*item.Item {
data, err := gamedata.GetDataByIntKey(CFG_RACE_TEMPLATE, Id)
data, err := gamedata.GetDataByIntKey(CFG_RACE_PASS, Id)
if err != nil {
return nil
}

View File

@ -82,11 +82,11 @@ func (r *RaceMod) GetReward() ([]*item.Item, error) {
return nil, fmt.Errorf("you are not the first")
}
Items := make([]*item.Item, 0)
Reward := raceCfg.GetReward(r.Id)
Reward := raceCfg.GetReward(r.Pass)
Items = append(Items, Reward...)
Now := GoUtil.Now()
if Now <= r.EndTime {
ExtraReward := raceCfg.GetExtraReward(r.Id)
ExtraReward := raceCfg.GetExtraReward(r.Pass)
Items = append(Items, ExtraReward...)
}
r.Pass++