赛跑活动
This commit is contained in:
parent
56d3b6d53a
commit
993b1b20b7
@ -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
|
||||
}
|
||||
|
||||
@ -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++
|
||||
|
||||
Loading…
Reference in New Issue
Block a user