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

fix damage adapter

parent cc3a866c
import { ygopro } from "../../../idl/ocgcore"; import { ygopro } from "../../../idl/ocgcore";
import { ocgDamageAdapter } from "rust-src"; import init, { ocgDamageAdapter } from "rust-src";
/* /*
* Msg Damage * Msg Damage
...@@ -7,8 +7,8 @@ import { ocgDamageAdapter } from "rust-src"; ...@@ -7,8 +7,8 @@ import { ocgDamageAdapter } from "rust-src";
* @param player - 玩家编号 * @param player - 玩家编号
* @param value - 减少的Hp数值 * @param value - 减少的Hp数值
* */ * */
export default (data: Uint8Array) => { export default async (data: Uint8Array) => {
const damage = ocgDamageAdapter(data); const damage = await init().then(() => ocgDamageAdapter(data));
return new ygopro.StocGameMessage.MsgUpdateHp(damage); 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