1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-04-27 08:57:45 +00:00

Fix action results not working

The opcode wasn't updated for 7.20h, and I think was overlapping with
some status effect list one (hence the weird stuff happening in the
update showcase video.) Also updated the testdata, even though it wasn't
needed.

I also added back the actor hp/mp update, because I deleted that
thinking it would fix something but it didn't.
This commit is contained in:
Joshua Goins 2025-04-18 12:38:02 -04:00
parent db877938ac
commit d507547dd3
4 changed files with 21 additions and 7 deletions

View file

@ -147,7 +147,7 @@
},
{
"name": "ActionResult",
"opcode": 508,
"opcode": 447,
"size": 124
},
{

Binary file not shown.

View file

@ -718,6 +718,9 @@ async fn client_loop(
_ => todo!()
}
}
let actor = *actor;
connection.update_hp_mp(actor.id, actor.hp, 10000).await;
}
let ipc = ServerZoneIpcSegment {
@ -733,6 +736,9 @@ async fn client_loop(
flag: 1,
effect_count: effects_builder.effects.len() as u8,
effects,
unk1: 2662353,
unk2: 3758096384,
hidden_animation: 1,
..Default::default()
}),
..Default::default()

View file

@ -69,17 +69,20 @@ mod tests {
let mut buffer = Cursor::new(&buffer);
let action_result = ActionResult::read_le(&mut buffer).unwrap();
assert_eq!(action_result.main_target.object_id, ObjectId(0x400097d0));
assert_eq!(
action_result.target_id_again.object_id,
ObjectId(0x400097d0)
);
assert_eq!(action_result.main_target.object_id, ObjectId(0x40070E42));
assert_eq!(action_result.action_id, 31);
assert_eq!(action_result.unk1, 2662353); // TODO: probably means this field is wrong
assert_eq!(action_result.animation_lock_time, 0.6);
assert_eq!(action_result.rotation, 1.9694216);
assert_eq!(action_result.unk2, 3758096384); // TODO: ditto
assert_eq!(action_result.hidden_animation, 1);
assert_eq!(action_result.rotation, 1.207309);
assert_eq!(action_result.action_animation_id, 31);
assert_eq!(action_result.variation, 0);
assert_eq!(action_result.flag, 1);
assert_eq!(action_result.unk3, 0);
assert_eq!(action_result.effect_count, 1);
assert_eq!(action_result.unk4, 0);
assert_eq!(action_result.unk5, [0; 6]);
// effect 0: attack
assert_eq!(action_result.effects[0].kind, EffectKind::Damage);
@ -92,5 +95,10 @@ mod tests {
// effect 1: start action combo
assert_eq!(action_result.effects[1].kind, EffectKind::BeginCombo);
assert_eq!(
action_result.target_id_again.object_id,
ObjectId(0x40070E42)
);
}
}