refactor(RespawnEquipment): 添加isVIP参数以区分普通玩家和VIP玩家
在DefaultPlayerEquipment方法中添加isVIP参数,用于区分普通玩家和VIP玩家的装备处理逻辑。普通玩家的装备创建逻辑暂时留空,待后续实现。
This commit is contained in:
@@ -61,10 +61,13 @@ class CustomMission: MissionServer
|
|||||||
|
|
||||||
string steamid = player.GetIdentity().GetPlainId();
|
string steamid = player.GetIdentity().GetPlainId();
|
||||||
ref PlayerRevivalEquipmentData rev = g_CustomRevivalSuitCfg.GetPlayerRevivalEquipmentData( steamid );
|
ref PlayerRevivalEquipmentData rev = g_CustomRevivalSuitCfg.GetPlayerRevivalEquipmentData( steamid );
|
||||||
|
bool isVIP = false;
|
||||||
if ( rev )
|
if ( rev )
|
||||||
|
{
|
||||||
|
isVIP = true;
|
||||||
ProcessVIPEquipment( player, rev );
|
ProcessVIPEquipment( player, rev );
|
||||||
|
}
|
||||||
DefaultPlayerEquipment( player, clothesChosen );
|
DefaultPlayerEquipment( player, clothesChosen, isVIP );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProcessVIPEquipment( PlayerBase player, ref PlayerRevivalEquipmentData equ_data )
|
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 itemClothing;
|
||||||
EntityAI itemEnt;
|
EntityAI itemEnt;
|
||||||
ItemBase itemBs;
|
ItemBase itemBs;
|
||||||
float rand;
|
float rand;
|
||||||
|
|
||||||
|
if ( !isVIP )
|
||||||
|
{
|
||||||
|
// TODO: 这里给普通玩家创建装备. 以前在StartingEquipSetup中如何给玩家创建新的装备这里就如何写
|
||||||
|
// player.RemoveAllItems(); // 移除所有默认装备
|
||||||
|
// itemEnt = player.GetInventory().CreateInInventory( "" /*这里写服装代码 */ );
|
||||||
|
}
|
||||||
|
|
||||||
itemClothing = player.FindAttachmentBySlotName( "Body" );
|
itemClothing = player.FindAttachmentBySlotName( "Body" );
|
||||||
if ( itemClothing )
|
if ( itemClothing )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user