Commit 6980b06b authored by Chunchi Che's avatar Chunchi Che

fix damage adapter

parent cc3a866c
import { ygopro } from "../../../idl/ocgcore";
import { ocgDamageAdapter } from "rust-src";
import init, { ocgDamageAdapter } from "rust-src";
/*
* Msg Damage
......@@ -7,8 +7,8 @@ import { ocgDamageAdapter } from "rust-src";
* @param player - 玩家编号
* @param value - 减少的Hp数值
* */
export default (data: Uint8Array) => {
const damage = ocgDamageAdapter(data);
export default async (data: Uint8Array) => {
const damage = await init().then(() => ocgDamageAdapter(data));
return new ygopro.StocGameMessage.MsgUpdateHp(damage);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment