lt 1 год назад
Родитель
Сommit
68dd4a8aa2

+ 10 - 0
RO_Server_Trunk-branch_0.1.39/roserver/game/model/role.go

@@ -3705,6 +3705,16 @@ func (this *Role) payInfoGet(goodsType, goodsId, count int32, rushStage, rushRou
 		return serverproto.ErrorCode_ERROR_FAIL, nil
 	}
 
+	//检测是否有充值卡自动使用
+	num := this.GetItemNum(1)
+	if num > 0 {
+		cfgData, ok := serverproto.ItemCfgLoader[1]
+		if ok {
+			payRewardInfo.Amount -= float32(cfgData.NatureType)
+		}
+		this.roleBag.DelItemById(1, 1, AddFrom_System)
+	}
+
 	payRewardInfo.GoodsName = service.GetServiceConfig().Node.PayCallBack
 	return serverproto.ErrorCode_ERROR_OK, payRewardInfo
 }

+ 1 - 0
RO_Server_Trunk-branch_0.1.39/roserver/serverproto/common.proto

@@ -63,6 +63,7 @@ enum ResType {
     Res_CreditRecharge              = 53; // 免费充值额度(充值钱包中能够获得的资源)
     Res_ROCoin                      = 54; // RO币
     Res_BoliShopExp                 = 55; // boli商城等级对应的经验
+    Res_RechargeCard                 = 56; // 充值卡
 }
 
 //Count表示N次操作,Num表示目标个数 [枚举:目标:条件]