mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 10:14:06 +02:00
store last medic target
This commit is contained in:
parent
42b63cc7eb
commit
e303969606
4 changed files with 23 additions and 16 deletions
|
|
@ -108,6 +108,7 @@ pub enum PlayerClassData {
|
|||
charge: u8,
|
||||
medigun: MedigunType,
|
||||
target: Option<EntityId>,
|
||||
last_target: Option<EntityId>,
|
||||
},
|
||||
Spy {
|
||||
disguise_team: Team,
|
||||
|
|
@ -123,6 +124,7 @@ impl PlayerClassData {
|
|||
charge: 0,
|
||||
medigun: MedigunType::Uber,
|
||||
target: None,
|
||||
last_target: None,
|
||||
},
|
||||
Class::Spy => PlayerClassData::Spy {
|
||||
disguise_team: Team::Other,
|
||||
|
|
|
|||
|
|
@ -48,8 +48,11 @@ pub fn handle_medigun_entity(
|
|||
.and_then(|self_handle| state.get_player_by_weapon_handle(self_handle));
|
||||
|
||||
if let Some(medic) = medic {
|
||||
if let PlayerClassData::Medic { target, .. } = &mut medic.class_data {
|
||||
if let PlayerClassData::Medic { target, last_target, .. } = &mut medic.class_data {
|
||||
*target = target_id;
|
||||
if target_id.is_some() {
|
||||
*last_target = target_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue