This commit is contained in:
aozhiwei 2023-05-25 14:40:04 +08:00
parent d56c31b355
commit f80db8d440
4 changed files with 42 additions and 2 deletions

View File

@ -2686,7 +2686,8 @@ void Human::ProcLootWeapon(AddItemDTO& dto)
void Human::ProcLootWeaponNew(AddItemDTO& dto)
{
if (GetCurrWeapon()->weapon_idx == GUN_SLOT1 ||
if (GetCurrWeapon()->weapon_idx == GUN_SLOT0 ||
GetCurrWeapon()->weapon_idx == GUN_SLOT1 ||
GetCurrWeapon()->weapon_idx == GUN_SLOT2) {
if (GetCurrWeapon()->weapon_id == dto.item_meta->id()) {
if (!GetCompose()->CanAdd()) {
@ -2698,7 +2699,12 @@ void Human::ProcLootWeaponNew(AddItemDTO& dto)
dto.handled = true;
} else {
int old_weapon_idx = GetCurrWeapon()->weapon_idx;
DropWeapon(GetCurrWeapon()->weapon_idx, 1);
if (GetCurrWeapon()->weapon_idx == GUN_SLOT0) {
old_weapon_idx = GUN_SLOT0;
DropWeapon(old_weapon_idx, 1);
} else {
DropWeapon(GetCurrWeapon()->weapon_idx, 1);
}
GetCompose()->Reset();
Weapon* weapon = &weapons[old_weapon_idx];
weapon->weapon_id = dto.item_id;

View File

@ -0,0 +1,14 @@
#include "precompile.h"
#include "mt/MapThingGroup.h"
IMPL_TABLE(mt::MapThingGroup)
namespace mt
{
void MapThingGroup::Init1()
{
}
}

View File

@ -0,0 +1,18 @@
#pragma once
#include "mt/macro.h"
#include "mtb/MapThingGroup.h"
namespace mt
{
DECLARE_ID_TABLE(MapThingGroup, mtb::MapThingGroup,
"mapThingGroup@mapThingGroup.json",
"mtGroupId")
public:
void Init1();
};
}

View File

@ -39,6 +39,7 @@
#include "mt/GraspBuff.h"
#include "mt/GuideStep.h"
#include "mt/MergeItem.h"
#include "mt/MapThingGroup.h"
#include "app.h"
@ -107,6 +108,7 @@ namespace mt
RegMetaTable<GraspBuff>(res_path_);
RegMetaTable<GuideStep>(res_path_);
RegMetaTable<MergeItem>(res_path_);
//RegMetaTable<MapThingGroup>(res_path_);
}
void MetaMgr::Load()