将 web-server 和 game-server 中的公共文件改为链接
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, arrayProp, Ref, mongoose } from '@typegoose/typegoose';
|
||||
import { index, getModelForClass, prop, Ref, mongoose } from '@typegoose/typegoose';
|
||||
import Equip from './Equip';
|
||||
|
||||
/**
|
||||
@@ -57,7 +57,9 @@ export default class Hero extends BaseModel {
|
||||
|
||||
public static async addEquip(roleId: string, hid: number, equipId: string, lean = true) {
|
||||
const hero = await HeroModel.findOneAndUpdate({ roleId, hid }, {$push: {equips: equipId}}, {new: true}).lean(lean);
|
||||
await Equip.putOn(hero.hid, equipId);
|
||||
if (hero) {
|
||||
await Equip.putOn(hero.hid, equipId);
|
||||
}
|
||||
return hero;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user