From d2632d04d407193a8e630edae8999c6268ad7bd1 Mon Sep 17 00:00:00 2001 From: Dcrclub Date: Mon, 21 Apr 2025 20:58:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor(RespawnEquipment):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0isVIP=E5=8F=82=E6=95=B0=E4=BB=A5=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E6=99=AE=E9=80=9A=E7=8E=A9=E5=AE=B6=E5=92=8CVIP=E7=8E=A9?= =?UTF-8?q?=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在DefaultPlayerEquipment方法中添加isVIP参数,用于区分普通玩家和VIP玩家的装备处理逻辑。普通玩家的装备创建逻辑暂时留空,待后续实现。 --- Mod/RespawnEqument/init.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Mod/RespawnEqument/init.c b/Mod/RespawnEqument/init.c index 3e8e003..a0e712e 100644 --- a/Mod/RespawnEqument/init.c +++ b/Mod/RespawnEqument/init.c @@ -61,10 +61,13 @@ class CustomMission: MissionServer string steamid = player.GetIdentity().GetPlainId(); ref PlayerRevivalEquipmentData rev = g_CustomRevivalSuitCfg.GetPlayerRevivalEquipmentData( steamid ); + bool isVIP = false; if ( rev ) + { + isVIP = true; ProcessVIPEquipment( player, rev ); - - DefaultPlayerEquipment( player, clothesChosen ); + } + DefaultPlayerEquipment( player, clothesChosen, isVIP ); } void ProcessVIPEquipment( PlayerBase player, ref PlayerRevivalEquipmentData equ_data ) @@ -109,13 +112,20 @@ class CustomMission: MissionServer } } - void DefaultPlayerEquipment( PlayerBase player, bool clothesChosen ) + void DefaultPlayerEquipment( PlayerBase player, bool clothesChosen, bool isVIP ) { EntityAI itemClothing; EntityAI itemEnt; ItemBase itemBs; float rand; + if ( !isVIP ) + { + // TODO: 这里给普通玩家创建装备. 以前在StartingEquipSetup中如何给玩家创建新的装备这里就如何写 + // player.RemoveAllItems(); // 移除所有默认装备 + // itemEnt = player.GetInventory().CreateInInventory( "" /*这里写服装代码 */ ); + } + itemClothing = player.FindAttachmentBySlotName( "Body" ); if ( itemClothing ) {