This commit is contained in:
aozhiwei 2023-03-03 17:38:56 +08:00
parent a29f8364f0
commit 0ff5409773
7 changed files with 16 additions and 9 deletions

View File

@ -282,7 +282,8 @@ void FrameEvent::AddWeaponAmmoChg(CreatureWeakPtr& sender)
( (
std::make_tuple(sender, std::make_tuple(sender,
sender.Get()->GetCurrWeapon()->weapon_idx, sender.Get()->GetCurrWeapon()->weapon_idx,
sender.Get()->GetCurrWeapon()->ammo sender.Get()->GetCurrWeapon()->ammo,
sender.Get()->GetCurrWeapon()->GetClipVolume(sender.Get())
) )
); );
int idx = room->frame_event_data->chged_weapon_ammo_.size() - 1; int idx = room->frame_event_data->chged_weapon_ammo_.size() - 1;

View File

@ -17,7 +17,7 @@ private:
std::vector<std::tuple<CreatureWeakPtr, ::cs::MFEffectChg>> chged_effects_; std::vector<std::tuple<CreatureWeakPtr, ::cs::MFEffectChg>> chged_effects_;
std::vector<std::tuple<CreatureWeakPtr, int, int>> chged_items_; std::vector<std::tuple<CreatureWeakPtr, int, int>> chged_items_;
std::vector<CreatureWeakPtr> chged_bullet_nums_; std::vector<CreatureWeakPtr> chged_bullet_nums_;
std::vector<std::tuple<CreatureWeakPtr, int, int>> chged_weapon_ammo_; std::vector<std::tuple<CreatureWeakPtr, int, int, int>> chged_weapon_ammo_;
std::vector<CreatureWeakPtr> chged_hps_; std::vector<CreatureWeakPtr> chged_hps_;
std::vector<std::tuple<CreatureWeakPtr, int, int>> chged_skillcds_; std::vector<std::tuple<CreatureWeakPtr, int, int>> chged_skillcds_;
std::vector<std::tuple<CreatureWeakPtr, int, int>> chged_skill_curr_times_; std::vector<std::tuple<CreatureWeakPtr, int, int>> chged_skill_curr_times_;

View File

@ -542,6 +542,7 @@ void FrameMaker::SerializeChgedWeaponAmmo(cs::SMUpdate* msg, Room* room, Human*
p->set_property_type(kPropWeaponAmmo); p->set_property_type(kPropWeaponAmmo);
p->set_property_subtype(std::get<1>(tuple)); p->set_property_subtype(std::get<1>(tuple));
p->set_value(std::get<2>(tuple)); p->set_value(std::get<2>(tuple));
p->set_value2(std::get<3>(tuple));
} }
} }
} }

View File

@ -1652,12 +1652,14 @@ void Player::UpdateThrowBomb()
RemoveBuffByEffectId(kBET_Hide); RemoveBuffByEffectId(kBET_Hide);
} }
--weapon.ammo; --weapon.ammo;
room->frame_event.AddPropChg room->frame_event.AddPropChgEx
( (
GetWeakPtrRef(), GetWeakPtrRef(),
kPropWeaponAmmo, kPropWeaponAmmo,
weapon.weapon_idx, weapon.weapon_idx,
weapon.ammo, weapon.ammo,
weapon.GetClipVolume(this),
0,
true true
); );
glm::vec3 bomb_pos = glm::vec3( glm::vec3 bomb_pos = glm::vec3(

View File

@ -4,6 +4,7 @@
#include "creature.h" #include "creature.h"
#include "battledatacontext.h" #include "battledatacontext.h"
#include "pbutils.h" #include "pbutils.h"
#include "human.h"
#include "mt/Equip.h" #include "mt/Equip.h"
@ -27,7 +28,11 @@ int Weapon::GetClipVolume(Creature* c)
if (c->GetBattleContext()) { if (c->GetBattleContext()) {
return c->GetBattleContext()->GetClipVolume(c, this); return c->GetBattleContext()->GetClipVolume(c, this);
} else { } else {
return meta ? meta->clip_volume() :0; if (c->IsHuman() && meta->_inventory_slot() > 0) {
return c->AsHuman()->GetVolume(meta->_inventory_slot());
} else {
return meta ? meta->clip_volume() :0;
}
} }
} }

View File

@ -111,9 +111,6 @@ message MFVec3
/* /*
property_type: 1 property_type: 1
property_type: 2 property_type: 2
property_type: 3
property_subtype:
valule:
property_type: 4 cd时间 property_type: 4 cd时间
property_type: 5 cd时间 property_type: 5 cd时间
property_type: 6 property_type: 6
@ -123,9 +120,10 @@ message MFVec3
property_type: 9 () property_type: 9 ()
property_subtype: id property_subtype: id
valule: (<=0) valule: (<=0)
property_type: 10 property_type: 10
property_subtype: property_subtype:
valule: valule:
valule2:
property_type: 11 property_type: 11
property_subtype: car_uniid property_subtype: car_uniid
valule: seat valule: seat

2
third_party/a8 vendored

@ -1 +1 @@
Subproject commit 7bd146740195fbf3d0268fd873708f4ec2f56ab6 Subproject commit 592661bae5547a0c1675816595b803f902d83041