diff --git a/ServerExt/Classes/ExtAutoPurchaseHelper.uc b/ServerExt/Classes/ExtAutoPurchaseHelper.uc index 3539ed0..395093f 100644 --- a/ServerExt/Classes/ExtAutoPurchaseHelper.uc +++ b/ServerExt/Classes/ExtAutoPurchaseHelper.uc @@ -24,13 +24,13 @@ function DoAutoPurchase() GetTraderItems(); EP = GetExtPerk(); - if(EP==None || EP.AutoBuyLoadOutPath.length == 0) + if (EP==None || EP.AutoBuyLoadOutPath.length == 0) return; - for(i = 0; i Perk; Perk = GetBasePerk(); - if(Perk!=None) + if (Perk!=None) { for (i = 0; i < OwnedItemList.length; i++) { - if(OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(Perk)!=INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1) + if (OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(Perk)!=INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1) { SellWeapon(OwnedItemList[i], i); i=-1; @@ -112,9 +112,9 @@ function SellOffPerkWeapons() for (i = 0; i < OwnedItemList.length; i++) { - if(OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(EP.BasePerk)==INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1 && OwnedItemList[i].SellPrice != 0) + if (OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(EP.BasePerk)==INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1 && OwnedItemList[i].SellPrice != 0) { - if(EP.AutoBuyLoadOutPath.Find(OwnedItemList[i].DefaultItem.WeaponDef) == INDEX_NONE) + if (EP.AutoBuyLoadOutPath.Find(OwnedItemList[i].DefaultItem.WeaponDef) == INDEX_NONE) { SellWeapon(OwnedItemList[i], i); i=-1; @@ -136,7 +136,7 @@ function InitializeOwnedItemList() TraderItems = KFGameReplicationInfo(WorldInfo.GRI).TraderItems; KFP = KFPawn_Human(Pawn); - if(KFP != none) + if (KFP != none) { // init armor purchase values ArmorItem.SpareAmmoCount = KFP.Armor; @@ -156,14 +156,14 @@ function InitializeOwnedItemList() for (Inv = MyKFIM.InventoryChain; Inv != none; Inv = Inv.Inventory) { KFW = KFWeapon(Inv); - if(KFW != none) + if (KFW != none) { // Set the weapon information and add it to the OwnedItemList SetWeaponInformation(KFW); } } - if(MyGfxManager != none && MyGfxManager.TraderMenu != none) + if (MyGfxManager != none && MyGfxManager.TraderMenu != none) { MyGfxManager.TraderMenu.OwnedItemList = OwnedItemList; } @@ -183,23 +183,23 @@ function int AddItemByPriority(out SItemInformation WeaponInfo) WeaponGroup = WeaponInfo.DefaultItem.InventoryGroup; WeaponPriority = WeaponInfo.DefaultItem.GroupPriority; - for(i = 0; i < OwnedItemList.length; i++) + for (i = 0; i < OwnedItemList.length; i++) { // If the weapon belongs in the group prior to the current weapon, we've found the spot - if(WeaponGroup < OwnedItemList[i].DefaultItem.InventoryGroup) + if (WeaponGroup < OwnedItemList[i].DefaultItem.InventoryGroup) { BestIndex = i; break; } - else if(WeaponGroup == OwnedItemList[i].DefaultItem.InventoryGroup) + else if (WeaponGroup == OwnedItemList[i].DefaultItem.InventoryGroup) { - if(WeaponPriority > OwnedItemList[i].DefaultItem.GroupPriority) + if (WeaponPriority > OwnedItemList[i].DefaultItem.GroupPriority) { // if the weapon is in the same group but has a higher priority, we've found the spot BestIndex = i; break; } - else if(WeaponPriority == OwnedItemList[i].DefaultItem.GroupPriority && WeaponInfo.DefaultItem.AssociatedPerkClasses.Find(Perk)>=0) + else if (WeaponPriority == OwnedItemList[i].DefaultItem.GroupPriority && WeaponInfo.DefaultItem.AssociatedPerkClasses.Find(Perk)>=0) { // if the weapons have the same priority give the slot to the on perk weapon BestIndex = i; @@ -215,14 +215,14 @@ function int AddItemByPriority(out SItemInformation WeaponInfo) OwnedItemList.InsertItem(BestIndex, WeaponInfo); // Add secondary ammo immediately after the main weapon - if(WeaponInfo.DefaultItem.WeaponDef.static.UsesSecondaryAmmo()) + if (WeaponInfo.DefaultItem.WeaponDef.static.UsesSecondaryAmmo()) { WeaponInfo.bIsSecondaryAmmo = true; WeaponInfo.SellPrice = 0; OwnedItemList.InsertItem(BestIndex + 1, WeaponInfo); } - if(MyGfxManager != none && MyGfxManager.TraderMenu != none) + if (MyGfxManager != none && MyGfxManager.TraderMenu != none) { MyGfxManager.TraderMenu.OwnedItemList = OwnedItemList; } @@ -234,7 +234,7 @@ function bool CanCarry(const out STraderItem Item, optional int OverrideLevelVal { local int Result; - Result = TotalBlocks + MyKFIM.GetDisplayedBlocksRequiredFor(Item); + Result = TotalBlocks + MyKFIM.GetDisplayedBlocksRequiredfor (Item); if (Result > MaxBlocks) { return false; diff --git a/ServerExt/Classes/ExtCharDataInfo.uc b/ServerExt/Classes/ExtCharDataInfo.uc index 86d7cd5..a8430fa 100644 --- a/ServerExt/Classes/ExtCharDataInfo.uc +++ b/ServerExt/Classes/ExtCharDataInfo.uc @@ -9,7 +9,7 @@ final function FMyCustomChar LoadData() { local FMyCustomChar R; - if(HasInit==0) + if (HasInit==0) { AttachmentMesh0 = 255; AttachmentMesh1 = 255; diff --git a/ServerExt/Classes/ExtCharacterInfo.uc b/ServerExt/Classes/ExtCharacterInfo.uc index 4e652e1..b138b10 100644 --- a/ServerExt/Classes/ExtCharacterInfo.uc +++ b/ServerExt/Classes/ExtCharacterInfo.uc @@ -10,18 +10,18 @@ static final function CloneMIC(MaterialInstanceConstant B) local LinearColor C; M = MaterialInstanceConstant(B.Parent); - if(M==None) + if (M==None) return; B.SetParent(M.Parent); - for(i=0; i 0) + if (C.BodyVariants.length > 0) { // Assign a skin to the body mesh as a material override CurrentBodyMeshIndex = (CurrentBodyMeshIndex < C.BodyVariants.length) ? CurrentBodyMeshIndex : 0; @@ -199,7 +199,7 @@ static final function SetBodySkinMaterial(KFCharacterInfo_Human C, OutfitVariant if (KFP.WorldInfo.NetMode != NM_DedicatedServer) { - if(CurrentVariant.SkinVariations.length > 0) + if (CurrentVariant.SkinVariations.length > 0) { // Assign a skin to the body mesh as a material override NewSkinIndex = (NewSkinIndex < CurrentVariant.SkinVariations.length) ? NewSkinIndex : 0; @@ -208,7 +208,7 @@ static final function SetBodySkinMaterial(KFCharacterInfo_Human C, OutfitVariant else { // Use material specified in the mesh asset - for(i=0; i 0) + if (CurrentVariant.SkinVariations.length > 0) { // Assign a skin to the body mesh as a material override NewSkinIndex = (NewSkinIndex < CurrentVariant.SkinVariations.length) ? NewSkinIndex : 0; @@ -231,7 +231,7 @@ static final function SetHeadSkinMaterial(KFCharacterInfo_Human C, OutfitVariant else { // Use material specified in the mesh asset - for(i=0; i 0) + if (CurrentVariant.AttachmentItem.SkinVariations.length > 0) { // Assign a skin to the attachment mesh as a material override if (NewSkinIndex < CurrentVariant.AttachmentItem.SkinVariations.length) @@ -329,7 +329,7 @@ static final function SetAttachmentSkinMaterial(KFCharacterInfo_Human C, else { // Use material specified in the mesh asset - for(i=0; i < KFP.ThirdPersonAttachments[PawnAttachmentIndex].GetNumElements(); i++) + for (i=0; i < KFP.ThirdPersonAttachments[PawnAttachmentIndex].GetNumElements(); i++) { KFP.ThirdPersonAttachments[PawnAttachmentIndex].SetMaterial(i, none); } @@ -392,7 +392,7 @@ static final function SetAttachmentMeshAndSkin(KFCharacterInfo_Human C, } // Set First Person Cosmetic if mesh exists for it. - if(CharAttachmentMeshName != "") + if (CharAttachmentMeshName != "") { // Set Cosmetic Mesh SetAttachmentMesh(C, CurrentAttachmentMeshIndex, AttachmentSlotIndex, CharAttachmentMeshName, CharAttachmentSocketName, AttachmentMesh, KFP, bIsFirstPerson); @@ -400,7 +400,7 @@ static final function SetAttachmentMeshAndSkin(KFCharacterInfo_Human C, else { // Make sure to clear out attachment if we're replacing with nothing. - if(bIsFirstPerson) + if (bIsFirstPerson) { KFP.FirstPersonAttachments[AttachmentSlotIndex] = none; KFP.FirstPersonAttachmentSocketNames[AttachmentSlotIndex] = ''; @@ -418,7 +418,7 @@ static final function SetAttachmentMeshAndSkin(KFCharacterInfo_Human C, } // Treat `CLEARED_ATTACHMENT_INDEX as special value (for client detachment) - if(CurrentAttachmentMeshIndex == `CLEARED_ATTACHMENT_INDEX) + if (CurrentAttachmentMeshIndex == `CLEARED_ATTACHMENT_INDEX) { C.RemoveAttachmentMeshAndSkin(AttachmentSlotIndex, KFP, KFPRI); } @@ -463,7 +463,7 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta } SkeletalAttachment.SetActorCollision(false, false); - if(bIsFirstPerson) + if (bIsFirstPerson) { KFP.FirstPersonAttachments[AttachmentSlotIndex] = SkeletalAttachment; } @@ -503,7 +503,7 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta StaticAttachment = new(KFP) class'StaticMeshComponent'; StaticAttachment.SetActorCollision(false, false); - if(bIsFirstPerson) + if (bIsFirstPerson) { KFP.FirstPersonAttachments[AttachmentSlotIndex] = StaticAttachment; } @@ -533,7 +533,7 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta AttachmentSocket.RelativeScale * AttachmentScaleRelativeToSocket); } - if(bIsFirstPerson) + if (bIsFirstPerson) { KFP.FirstPersonAttachmentSocketNames[AttachmentSlotIndex] = CharAttachmentSocketName; } @@ -563,14 +563,14 @@ static final function DetachConflictingAttachments(KFCharacterInfo_Human C, int // The socket that this attachment requires NewAttachmentSocketName = C.CosmeticVariants[NewAttachmentMeshIndex].AttachmentItem.SocketName; - for(i=0; i < `MAX_COSMETIC_ATTACHMENTS; i++) + for (i=0; i < `MAX_COSMETIC_ATTACHMENTS; i++) { CurrentAttachmentIdx = EPRI.CustomCharacter.AttachmentMeshIndices[i]; if (CurrentAttachmentIdx == `CLEARED_ATTACHMENT_INDEX) continue; // Remove the object if it is taking up our desired slot - if(KFP.ThirdPersonAttachmentSocketNames[i] != '' && + if (KFP.ThirdPersonAttachmentSocketNames[i] != '' && KFP.ThirdPersonAttachmentSocketNames[i] == NewAttachmentSocketName) { C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI); @@ -578,14 +578,14 @@ static final function DetachConflictingAttachments(KFCharacterInfo_Human C, int } // Remove the object if it cannot exist at the same time as another equipped item - if(C.GetOverrideCase(CurrentAttachmentIdx, NewAttachmentMeshIndex)) + if (C.GetOverrideCase(CurrentAttachmentIdx, NewAttachmentMeshIndex)) { C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI); continue; } // Check inverse override - if(C.GetOverrideCase(NewAttachmentMeshIndex, CurrentAttachmentIdx)) + if (C.GetOverrideCase(NewAttachmentMeshIndex, CurrentAttachmentIdx)) { C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI); continue; @@ -633,7 +633,7 @@ static final function SetFirstPersonArmsFromArch(KFCharacterInfo_Human C, KFPawn } // Hack fix for a material bug on KF2 - if(bCustom && KFP.ArmsMesh.SkeletalMesh!=None && KFP.ArmsMesh.GetMaterial(0)!=None) + if (bCustom && KFP.ArmsMesh.SkeletalMesh!=None && KFP.ArmsMesh.GetMaterial(0)!=None) { M = KFP.ArmsMesh.CreateAndSetMaterialInstanceConstant(0); CloneMIC(M); @@ -650,7 +650,7 @@ static function int GetAttachmentSlotIndex( local ExtPlayerReplicationInfo EPRI; local bool bCustom; - if(KFPRI == None) + if (KFPRI == None) { `warn("GetAttachmentSlotIndex - NO KFPRI"); return INDEX_NONE; @@ -660,10 +660,10 @@ static function int GetAttachmentSlotIndex( bCustom = (EPRI!=None ? EPRI.UsesCustomChar() : false); // Return the next available attachment index or the index that matches this mesh - for(AttachmentIdx = 0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++) + for (AttachmentIdx = 0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++) { CosmeticMeshIdx = bCustom ? EPRI.CustomCharacter.AttachmentMeshIndices[AttachmentIdx] : KFPRI.RepCustomizationInfo.AttachmentMeshIndices[AttachmentIdx]; - if(CosmeticMeshIdx == INDEX_NONE || CosmeticMeshIdx == CurrentAttachmentMeshIndex) + if (CosmeticMeshIdx == INDEX_NONE || CosmeticMeshIdx == CurrentAttachmentMeshIndex) { return AttachmentIdx; } diff --git a/ServerExt/Classes/ExtEmoteList.uc b/ServerExt/Classes/ExtEmoteList.uc index 1b743a6..86fc91a 100644 --- a/ServerExt/Classes/ExtEmoteList.uc +++ b/ServerExt/Classes/ExtEmoteList.uc @@ -10,16 +10,16 @@ static final function name GetUnlockedEmote(int ItemId, ExtPlayerController PC) local ExtPlayerReplicationInfo PRI; i = default.Emotes.Find('Id', ItemId); - if(i > -1) + if (i > -1) { Anim = default.Emotes[i].AnimName; PRI = ExtPlayerReplicationInfo(PC.PlayerReplicationInfo); - if(PRI == None) + if (PRI == None) return Anim; /* - if(InStr(string(Anim), "Deluxe") != INDEX_NONE && PRI.AdminType == 255) + if (InStr(string(Anim), "Deluxe") != INDEX_NONE && PRI.AdminType == 255) return 'NONE'; */ else return Anim; @@ -30,7 +30,7 @@ static final function name GetUnlockedEmote(int ItemId, ExtPlayerController PC) static final function SaveEquippedEmote(int ItemId, ExtPlayerController PC) { - if(PC == None) + if (PC == None) return; PC.SelectedEmoteIndex = ItemId; @@ -46,7 +46,7 @@ static final function byte GetEmoteIndex(int ItemId) { local int i; i = default.Emotes.Find('Id', ItemId); - if(i > -1) + if (i > -1) return i; return -1; @@ -54,7 +54,7 @@ static final function byte GetEmoteIndex(int ItemId) static final function int GetEquippedEmoteId(ExtPlayerController PC) { - if(PC == None) + if (PC == None) return -1; return PC.SelectedEmoteIndex; diff --git a/ServerExt/Classes/ExtExplosion_SirenScream.uc b/ServerExt/Classes/ExtExplosion_SirenScream.uc index 5667c7f..3448e5b 100644 --- a/ServerExt/Classes/ExtExplosion_SirenScream.uc +++ b/ServerExt/Classes/ExtExplosion_SirenScream.uc @@ -1,6 +1,6 @@ class ExtExplosion_SirenScream extends KFExplosion_SirenScream; -protected function SpecialCringeEffectsFor(Actor Victim, float VictimDist) +protected function SpecialCringeEffectsfor (Actor Victim, float VictimDist) { return; } diff --git a/ServerExt/Classes/ExtGUI_PerkSelectionPage.uc b/ServerExt/Classes/ExtGUI_PerkSelectionPage.uc index 70870ff..5ea1950 100644 --- a/ServerExt/Classes/ExtGUI_PerkSelectionPage.uc +++ b/ServerExt/Classes/ExtGUI_PerkSelectionPage.uc @@ -8,7 +8,7 @@ function InitMenu() PageSwitcher = KFGUI_SwitchMenuBar(FindComponentID('Pager')); Super(KFGUI_Page).InitMenu(); - for(i=0; iLastWaveMax) + if (LastWave>LastWaveMax) { SetInt("currentWave",0); // Force text to refresh. SetString("finalText", "END"); diff --git a/ServerExt/Classes/ExtHUD_WeaponSelectWidget.uc b/ServerExt/Classes/ExtHUD_WeaponSelectWidget.uc index caef228..90dfe67 100644 --- a/ServerExt/Classes/ExtHUD_WeaponSelectWidget.uc +++ b/ServerExt/Classes/ExtHUD_WeaponSelectWidget.uc @@ -29,7 +29,7 @@ simulated function UpdateWeaponGroupOnHUD(byte GroupIndex) for (i = 0; i < WeaponsList.Length; i++) { Index = TraderItems.SaleItems.Find('ClassName', WeaponsList[i].Class.Name); - if(Index != -1) + if (Index != -1) WPGroup[i] = TraderItems.SaleItems[Index].WeaponDef; } @@ -52,7 +52,7 @@ simulated function SetWeaponGroupList(out array WeaponList, byte Group { TempObj = CreateObject("Object"); - if(WeaponGroup[i] != None) + if (WeaponGroup[i] != None) { TempObj.SetString("weaponName", WeaponGroup[i].static.GetItemLocalization("ItemName")); TempObj.SetString("texturePath", "img://"$WeaponGroup[i].static.GetImagePath()); @@ -69,7 +69,7 @@ simulated function SetWeaponGroupList(out array WeaponList, byte Group //secondary ammo shenanigans TempObj.SetBool("bUsesSecondaryAmmo", WeaponList[i].UsesSecondaryAmmo()&&WeaponList[i].bCanRefillSecondaryAmmo); TempObj.SetBool("bEnabled", WeaponList[i].HasAnyAmmo()); - if(WeaponList[i].UsesSecondaryAmmo() && WeaponList[i].bCanRefillSecondaryAmmo) + if (WeaponList[i].UsesSecondaryAmmo() && WeaponList[i].bCanRefillSecondaryAmmo) { TempObj.SetBool("bCanRefillSecondaryAmmo", WeaponList[i].SpareAmmoCapacity[1] > 0); TempObj.SetInt("secondaryAmmoCount", WeaponList[i].AmmoCount[1]); diff --git a/ServerExt/Classes/ExtHumanPawn.uc b/ServerExt/Classes/ExtHumanPawn.uc index 2ebf3fb..f3ae20d 100644 --- a/ServerExt/Classes/ExtHumanPawn.uc +++ b/ServerExt/Classes/ExtHumanPawn.uc @@ -18,17 +18,17 @@ var byte HealingShieldMod,HealingSpeedBoostMod,HealingDamageBoostMod; replication { - if(true) + if (true) bFeigningDeath,RepRegenHP,BackpackWeaponClass; - if(bNetOwner) + if (bNetOwner) bHasBunnyHop; - if(bNetDirty) + if (bNetDirty) HealingSpeedBoostMod, HealingDamageBoostMod, HealingShieldMod; } function TakeDamage(int Damage, Controller InstigatedBy, vector HitLocation, vector Momentum, class DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) { - if(KnockbackResist<1) + if (KnockbackResist<1) Momentum *= KnockbackResist; Super.TakeDamage(Damage,InstigatedBy,HitLocation,Momentum,DamageType,HitInfo,DamageCauser); } @@ -40,9 +40,9 @@ simulated function bool Died(Controller Killer, class damageType, ve local PlayerReplicationInfo KillerPRI; local SeqAct_Latent Action; - if(WorldInfo.NetMode!=NM_Client && PlayerReplicationInfo!=None) + if (WorldInfo.NetMode!=NM_Client && PlayerReplicationInfo!=None) { - if(Killer==None || Killer==Controller) + if (Killer==None || Killer==Controller) { KillerPRI = PlayerReplicationInfo; KillerPawn = None; @@ -50,10 +50,10 @@ simulated function bool Died(Controller Killer, class damageType, ve else { KillerPRI = Killer.PlayerReplicationInfo; - if(KillerPRI==None || KillerPRI.Team!=PlayerReplicationInfo.Team) + if (KillerPRI==None || KillerPRI.Team!=PlayerReplicationInfo.Team) { KillerPawn = Killer.Pawn!=None ? Killer.Pawn.Class : None; - if(PlayerController(Killer)==None) // If was killed by a monster, don't broadcast PRI along with it. + if (PlayerController(Killer)==None) // If was killed by a monster, don't broadcast PRI along with it. KillerPRI = None; } else KillerPawn = None; @@ -62,7 +62,7 @@ simulated function bool Died(Controller Killer, class damageType, ve C.ClientKillMessage(damageType,PlayerReplicationInfo,KillerPRI,KillerPawn); } // If got killed by a zombie, turn player into a ragdoll and let em take control of a newly spawned ZED over the ragdoll. - if(bRedeadMode && WorldInfo.NetMode!=NM_Client && damageType!=None && Killer!=None && Killer!=Controller && Killer.GetTeamNum()!=0) + if (bRedeadMode && WorldInfo.NetMode!=NM_Client && damageType!=None && Killer!=None && Killer!=Controller && Killer.GetTeamNum()!=0) { if (bDeleteMe || WorldInfo.Game == None || WorldInfo.Game.bLevelChange) return FALSE; @@ -75,7 +75,7 @@ simulated function bool Died(Controller Killer, class damageType, ve } Health = 0; foreach LatentActions(Action) - Action.AbortFor(self); + Action.Abortfor (self); if (Controller != None) WorldInfo.Game.Killed(Killer, Controller, self, damageType); else WorldInfo.Game.Killed(Killer, Controller(Owner), self, damageType); @@ -84,7 +84,7 @@ simulated function bool Died(Controller Killer, class damageType, ve InvManager.OwnerDied(); Health = 1; - if(!bFeigningDeath) + if (!bFeigningDeath) PlayFeignDeath(true,,true); Health = 0; ClearTimer('UnsetFeignDeath'); @@ -123,92 +123,92 @@ event bool HealDamage(int Amount, Controller Healer, class DamageTyp InstigatorPC = ExtPlayerController(Healer); InstigatorPerk = InstigatorPC.GetPerk(); - if(InstigatorPerk != None && bCanRepairArmor) + if (InstigatorPerk != None && bCanRepairArmor) bRepairedArmor = InstigatorPC.GetPerk().RepairArmor(self); EPRI = ExtPlayerReplicationInfo(InstigatorPC.PlayerReplicationInfo); - if(EPRI != none) + if (EPRI != none) { InstigatorExtPerk = ExtPlayerController(Controller).ActivePerkManager.CurrentPerk; - if(InstigatorExtPerk != none && Ext_PerkFieldMedic(InstigatorExtPerk) != none) + if (InstigatorExtPerk != none && Ext_PerkFieldMedic(InstigatorExtPerk) != none) { - if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingBoost) + if (Ext_PerkFieldMedic(InstigatorExtPerk).bHealingBoost) UpdateHealingSpeedBoostMod(InstigatorPC); - if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingDamageBoost) + if (Ext_PerkFieldMedic(InstigatorExtPerk).bHealingDamageBoost) UpdateHealingDamageBoostMod(InstigatorPC); - if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingShield) + if (Ext_PerkFieldMedic(InstigatorExtPerk).bHealingShield) UpdateHealingShieldMod(InstigatorPC); } } - if(Amount > 0 && IsAliveAndWell() && Health < HealthMax) + if (Amount > 0 && IsAliveAndWell() && Health < HealthMax) { // Play any healing effects attached to this damage type KFDT = class(DamageType); - if(KFDT != none && KFDT.default.bNoPain) + if (KFDT != none && KFDT.default.bNoPain) PlayHeal(KFDT); - if(Role == ROLE_Authority) + if (Role == ROLE_Authority) { - if(Healer==None || Healer.PlayerReplicationInfo == None) + if (Healer==None || Healer.PlayerReplicationInfo == None) return false; InstigatorPRI = KFPlayerReplicationInfo(Healer.PlayerReplicationInfo); ScAmount = Amount; - if(InstigatorPerk != none) + if (InstigatorPerk != none) InstigatorPerk.ModifyHealAmount(ScAmount); UsedHealAmount = ScAmount; // You can never have a HealthToRegen value that's greater than HealthMax - if(Health + HealthToRegen + UsedHealAmount > HealthMax) + if (Health + HealthToRegen + UsedHealAmount > HealthMax) UsedHealAmount = Min(HealthMax - (Health + HealthToRegen),255-HealthToRegen); else UsedHealAmount = Min(UsedHealAmount,255-HealthToRegen); HealthToRegen += UsedHealAmount; RepRegenHP = HealthToRegen; - if(!IsTimerActive('GiveHealthOverTime')) + if (!IsTimerActive('GiveHealthOverTime')) SetTimer(HealthRegenRate, true, 'GiveHealthOverTime'); // Give the healer money/XP for helping a teammate - if(Healer.Pawn != none && Healer.Pawn != self) + if (Healer.Pawn != none && Healer.Pawn != self) { DoshEarned = (UsedHealAmount / float(HealthMax)) * HealerRewardScaler; - if(InstigatorPRI!=None) + if (InstigatorPRI!=None) InstigatorPRI.AddDosh(Max(DoshEarned, 0), true); - if(InstigatorPC!=None) + if (InstigatorPC!=None) InstigatorPC.AddHealPoints(UsedHealAmount); } - if(Healer.bIsPlayer) + if (Healer.bIsPlayer) { - if(Healer != Controller) + if (Healer != Controller) { - if(InstigatorPC!=None) + if (InstigatorPC!=None) { - if(!InstigatorPC.bClientHideNumbers) + if (!InstigatorPC.bClientHideNumbers) InstigatorPC.ClientNumberMsg(UsedHealAmount,Location,DMG_Heal); InstigatorPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedPlayer, PlayerReplicationInfo); } KFPC = ExtPlayerController(Controller); - if(KFPC!=None) + if (KFPC!=None) KFPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedBy, Healer.PlayerReplicationInfo); } - else if(bMessageHealer && InstigatorPC!=None) + else if (bMessageHealer && InstigatorPC!=None) InstigatorPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedSelf, PlayerReplicationInfo); } // don't play dialog for healing done through perk skills (e.g. berserker vampire skill) - if(bMessageHealer) + if (bMessageHealer) { `DialogManager.PlayHealingDialog(KFPawn(Healer.Pawn), self, float(Health + HealthToRegen) / float(HealthMax)); } // Reduce burn duration and damage in half if you heal while burning - for(i = 0; i < DamageOverTimeArray.Length; ++i) + for (i = 0; i < DamageOverTimeArray.Length; ++i) { - if(DamageOverTimeArray[i].DoT_Type == DOT_Fire) + if (DamageOverTimeArray[i].DoT_Type == DOT_Fire) { DamageOverTimeArray[i].Duration *= 0.5; DamageOverTimeArray[i].Damage *= 0.5; @@ -231,7 +231,7 @@ function GiveHealthOverTime() simulated event ReplicatedEvent(name VarName) { - switch(VarName) + switch (VarName) { case 'bFeigningDeath': PlayFeignDeath(bFeigningDeath); @@ -248,11 +248,11 @@ simulated event ReplicatedEvent(name VarName) // Feign death triggers: function PlayHit(float Damage, Controller InstigatedBy, vector HitLocation, class damageType, vector Momentum, TraceHitInfo HitInfo) { - if(damageType!=class'DmgType_Fell') // Not from falling! + if (damageType!=class'DmgType_Fell') // Not from falling! { - if(bRagdollFromMomentum && Damage>2 && VSizeSq(Momentum)>1000000.f && Rand(3)==0) // Square(1000) + if (bRagdollFromMomentum && Damage>2 && VSizeSq(Momentum)>1000000.f && Rand(3)==0) // Square(1000) SetFeignDeath(3.f+FRand()*2.5f); // Randomly knockout a player if hit by a huge force. - else if(bRagdollFromBackhit && Damage>20 && VSizeSq(Momentum)>40000.f && (vector(Rotation) Dot Momentum)>0.f && Rand(4)==0) + else if (bRagdollFromBackhit && Damage>20 && VSizeSq(Momentum)>40000.f && (vector(Rotation) Dot Momentum)>0.f && Rand(4)==0) SetFeignDeath(2.f+FRand()*3.f); // Randomly knockout a player if hit from behind. } Super.PlayHit(Damage,InstigatedBy,HitLocation,damageType,Momentum,HitInfo); @@ -262,10 +262,10 @@ event Landed(vector HitNormal, actor FloorActor) local float ExcessSpeed; Super.Landed(HitNormal, FloorActor); - if(bRagdollFromFalling) + if (bRagdollFromFalling) { ExcessSpeed = Velocity.Z / (-MaxFallSpeed); - if(ExcessSpeed>1.25) // Knockout a player after landed from too high. + if (ExcessSpeed>1.25) // Knockout a player after landed from too high. { Velocity.Z = 0; // Dont go clip through floor now... Velocity.X*=0.5; @@ -273,7 +273,7 @@ event Landed(vector HitNormal, actor FloorActor) SetFeignDeath((3.f+FRand())*ExcessSpeed); } } - else if(BHopAccelSpeed>0) + else if (BHopAccelSpeed>0) SetTimer((IsLocallyControlled() ? 0.17 : 1.f),false,'ResetBHopAccel'); // Replicating from client to server here because Server Tickrate may screw clients over from executing bunny hopping. } @@ -286,14 +286,14 @@ function bool DoJump(bool bUpdating) if (Super.DoJump(bUpdating)) { // Accelerate if bunnyhopping. - if(bHasBunnyHop && VSizeSq2D(Velocity)>Square(GroundSpeed*0.75)) + if (bHasBunnyHop && VSizeSq2D(Velocity)>Square(GroundSpeed*0.75)) { - if(BHopAccelSpeed<20) + if (BHopAccelSpeed<20) { - if(BHopAccelSpeed==0) + if (BHopAccelSpeed==0) BHopSpeedMod = 1.f; - if(BHopAccelSpeed<5) + if (BHopAccelSpeed<5) V = 1.15; else { @@ -315,13 +315,13 @@ function bool DoJump(bool bUpdating) } simulated function ResetBHopAccel(optional bool bSkipRep) // Set on Landed, or Tick if falling 2D speed is too low. { - if(BHopAccelSpeed>0) + if (BHopAccelSpeed>0) { BHopAccelSpeed = 0; AirControl = Default.AirControl; GroundSpeed /= BHopSpeedMod; UpdateGroundSpeed(); - if(WorldInfo.NetMode==NM_Client && !bSkipRep) + if (WorldInfo.NetMode==NM_Client && !bSkipRep) NotifyHasStopped(); } } @@ -335,7 +335,7 @@ function UpdateGroundSpeed() InvM = KFInventoryManager(InvManager); HealthMod = (InvM != None) ? InvM.GetEncumbranceSpeedMod() : 1.f * (1.f - LowHealthSpeedPenalty); - if(BHopAccelSpeed>0) + if (BHopAccelSpeed>0) HealthMod *= BHopSpeedMod; // First reset to default so multipliers do not stack @@ -344,7 +344,7 @@ function UpdateGroundSpeed() SprintSpeed = default.SprintSpeed * HealthMod; // Ask our perk to set the new ground speed based on weapon type - if(GetPerk() != none) + if (GetPerk() != none) { GetPerk().ModifySpeed(GroundSpeed); GetPerk().ModifySpeed(SprintSpeed); @@ -361,19 +361,19 @@ reliable server function NotifyHasStopped() simulated function Tick(float Delta) { Super.Tick(Delta); - if(bPlayingFeignDeathRecovery) + if (bPlayingFeignDeathRecovery) { // interpolate Controller yaw to our yaw so that we don't get our rotation snapped around when we get out of feign death Mesh.PhysicsWeight = FMax(Mesh.PhysicsWeight-(Delta*2.f),0.f); - if(Mesh.PhysicsWeight<=0) + if (Mesh.PhysicsWeight<=0) StartFeignDeathRecoveryAnim(); } - if(BHopAccelSpeed>0) + if (BHopAccelSpeed>0) { - if(Physics==PHYS_Falling && VSizeSq2D(Velocity)0 && bCanBecomeRagdoll && NoRagdollChance<1.f && (NoRagdollChance==0.f || FRand()>NoRagdollChance)) + if (WorldInfo.NetMode!=NM_Client && !bFeigningDeath && Health>0 && bCanBecomeRagdoll && NoRagdollChance<1.f && (NoRagdollChance==0.f || FRand()>NoRagdollChance)) { Time = FMax(1.f,Time); PlayFeignDeath(true); @@ -399,7 +399,7 @@ function SetFeignDeath(float Time) } function UnsetFeignDeath() { - if(bFeigningDeath) + if (bFeigningDeath) PlayFeignDeath(false); } @@ -409,7 +409,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b local rotator NewRotation; local float UnFeignZAdjust; - if(Health<=0 && WorldInfo.NetMode!=NM_Client) + if (Health<=0 && WorldInfo.NetMode!=NM_Client) return; // If dead, don't do it. NotifyOutOfBattery(); // Stop nightvision on client. @@ -417,7 +417,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b bFeigningDeath = bEnable; if (bEnable) { - if(bFPLegsAttached) + if (bFPLegsAttached) { bFPLegsAttached = false; DetachComponent(FPBodyMesh); @@ -427,7 +427,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b bPlayingFeignDeathRecovery = false; ClearTimer('OnWakeUpFinished'); - if(!bTransformMode) + if (!bTransformMode) GotoState('FeigningDeath'); // if we had some other rigid body thing going on, cancel it @@ -452,9 +452,9 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b Mesh.SetHasPhysicsAssetInstance(false); - if(!InitRagdoll()) // Ragdoll error! + if (!InitRagdoll()) // Ragdoll error! { - if(PlayerController(Controller)!=None) + if (PlayerController(Controller)!=None) PlayerController(Controller).ClientMessage("Error: InitRagdoll() failed!"); return; } @@ -467,7 +467,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b // Set all kinematic bodies to the current root velocity, since they may not have been updated during normal animation // and therefore have zero derived velocity (this happens in 1st person camera mode). UnFeignZAdjust = VSize(Velocity); - if(UnFeignZAdjust>700.f) // Limit by a maximum velocity force to prevent from going through walls. + if (UnFeignZAdjust>700.f) // Limit by a maximum velocity force to prevent from going through walls. Mesh.SetRBLinearVelocity((Velocity/UnFeignZAdjust)*700.f, false); else Mesh.SetRBLinearVelocity(Velocity, false); @@ -514,7 +514,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b // Calculate how far we just moved the actor up. UnFeignZAdjust = Location.Z - FeignLocation.Z; // If its positive, move back down by that amount until it hits the floor - if(UnFeignZAdjust > 0.0) + if (UnFeignZAdjust > 0.0) { moveSmooth(vect(0,0,-1) * UnFeignZAdjust); } @@ -552,7 +552,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b else FeignRecoverAnim = 'Getup_F_V1'; // Init wakeup anim. - if(Mesh.AnimSets.Find(WakeUpAnimSet)==-1) + if (Mesh.AnimSets.Find(WakeUpAnimSet)==-1) Mesh.AnimSets.AddItem(WakeUpAnimSet); BodyStanceNodes[EAS_FullBody].bNoNotifies = true; BodyStanceNodes[EAS_FullBody].PlayCustomAnim(FeignRecoverAnim,0.025f,,,,true); @@ -568,7 +568,7 @@ final function vector PickNearestNode() foreach WorldInfo.AllNavigationPoints(class'NavigationPoint',N) { Dist = VSizeSq(N.Location-Location); - if(Best==None || Dist DamageType, vector HitLoc) Mesh.SetHasPhysicsAssetInstance(false); Mesh.SetHasPhysicsAssetInstance(true); - if(bFPLegsAttached) + if (bFPLegsAttached) { bFPLegsAttached = false; DetachComponent(FPBodyMesh); @@ -682,7 +682,7 @@ simulated function PlayRagdollDeath(class DamageType, vector HitLoc) CheckHitInfo(HitInfo, Mesh, HitDirection, HitLoc); // Play ragdoll death animation (bSkipReplication=TRUE) - if(CanDoSpecialMove(SM_DeathAnim) && ClassIsChildOf(DamageType, class'KFDamageType')) + if (CanDoSpecialMove(SM_DeathAnim) && ClassIsChildOf(DamageType, class'KFDamageType')) { DoSpecialMove(SM_DeathAnim, TRUE,,,TRUE); KFSM_DeathAnim(SpecialMoves[SM_DeathAnim]).PlayDeathAnimation(DamageType, HitDirection, HitInfo.BoneName); @@ -695,7 +695,7 @@ simulated function PlayRagdollDeath(class DamageType, vector HitLoc) } simulated function StartFeignDeathRecoveryAnim() { - if(FPBodyMesh!=None && !bFPLegsAttached && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs) + if (FPBodyMesh!=None && !bFPLegsAttached && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs) { bFPLegsAttached = true; AttachComponent(FPBodyMesh); @@ -729,7 +729,7 @@ function AddDefaultInventory() local KFPerk MyPerk; MyPerk = GetPerk(); - if(MyPerk != none) + if (MyPerk != none) MyPerk.AddDefaultInventory(self); Super(KFPawn).AddDefaultInventory(); @@ -748,7 +748,7 @@ simulated event OutsideWorldBounds() simulated function KFCharacterInfoBase GetCharacterInfo() { - if(ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) + if (ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch(); return Super.GetCharacterInfo(); } @@ -779,7 +779,7 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor WeaponAttachmentChanged(true); } } - if(WorldInfo.NetMode != NM_DedicatedServer) + if (WorldInfo.NetMode != NM_DedicatedServer) { // Attach/Reattach flashlight components when mesh is set if (Flashlight == None && FlashLightTemplate != None) @@ -791,9 +791,9 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor Flashlight.AttachFlashlight(Mesh); } } - if(CharacterArch != none) + if (CharacterArch != none) { - if(CharacterArch.VoiceGroupArchName != "") + if (CharacterArch.VoiceGroupArchName != "") VoiceGroupArch = class(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class')); } } @@ -852,9 +852,9 @@ ignores FaceRotation, SetMovementPhysics; { local rotator NewRotation; - if(bPlayingFeignDeathRecovery) + if (bPlayingFeignDeathRecovery) { - if(PlayerController(Controller) != None) + if (PlayerController(Controller) != None) { // interpolate Controller yaw to our yaw so that we don't get our rotation snapped around when we get out of feign death NewRotation = Controller.Rotation; @@ -862,7 +862,7 @@ ignores FaceRotation, SetMovementPhysics; Controller.SetRotation(NewRotation); } Mesh.PhysicsWeight = FMax(Mesh.PhysicsWeight-(DeltaTime*2.f),0.f); - if(Mesh.PhysicsWeight<=0) + if (Mesh.PhysicsWeight<=0) StartFeignDeathRecoveryAnim(); } } @@ -872,7 +872,7 @@ ignores FaceRotation, SetMovementPhysics; local KFWeapon UTWeap; // Abort current special move - if(IsDoingSpecialMove()) + if (IsDoingSpecialMove()) SpecialMoveHandler.EndSpecialMove(); bCanPickupInventory = false; @@ -885,11 +885,11 @@ ignores FaceRotation, SetMovementPhysics; UTWeap.SetIronSights(false); UTWeap.PlayWeaponPutDown(0.5f); } - if(WorldInfo.NetMode!=NM_Client) + if (WorldInfo.NetMode!=NM_Client) { - if(ExtPlayerController(Controller)!=None) + if (ExtPlayerController(Controller)!=None) ExtPlayerController(Controller).EnterRagdollMode(true); - else if(Controller!=None) + else if (Controller!=None) Controller.ReplicatedEvent('RagdollMove'); } } @@ -905,7 +905,7 @@ ignores FaceRotation, SetMovementPhysics; } function bool CanBeRedeemed() { - if(bFeigningDeath) + if (bFeigningDeath) PlayFeignDeath(false,true); NextRedeemTimer = WorldInfo.TimeSeconds+0.25; return false; @@ -930,11 +930,11 @@ ignores FaceRotation, SetMovementPhysics; Global.SetMovementPhysics(); bPlayingFeignDeathRecovery = false; - if(WorldInfo.NetMode!=NM_Client) + if (WorldInfo.NetMode!=NM_Client) { - if(ExtPlayerController(Controller)!=None) + if (ExtPlayerController(Controller)!=None) ExtPlayerController(Controller).EnterRagdollMode(false); - else if(Controller!=None) + else if (Controller!=None) Controller.ReplicatedEvent('EndRagdollMove'); } @@ -952,9 +952,9 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die { bCanPickupInventory = false; bNoWeaponFiring = true; - if(ExtPlayerController(Controller)!=None) + if (ExtPlayerController(Controller)!=None) ExtPlayerController(Controller).EnterRagdollMode(true); - else if(Controller!=None) + else if (Controller!=None) Controller.ReplicatedEvent('RagdollMove'); SetTimer(2,false,'TransformToZed'); @@ -970,7 +970,7 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die { local VS_ZedRecentZed Z; - if(Controller==None) + if (Controller==None) { Destroy(); return; @@ -978,7 +978,7 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die PlayFeignDeath(false); SetCollision(false,false); Z = Spawn(class'VS_ZedRecentZed',,,Location,Rotation,,true); - if(Z==None) + if (Z==None) { Super.Died(None,Class'DamageType',Location); return; @@ -991,12 +991,12 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die Controller.Possess(Z,false); WorldInfo.Game.ChangeTeam(Controller,255,true); WorldInfo.Game.SetPlayerDefaults(Z); - if(ExtPlayerController(Controller)!=None) + if (ExtPlayerController(Controller)!=None) Controller.GoToState('RagdollMove'); - else if(Controller!=None) + else if (Controller!=None) Controller.ReplicatedEvent('RagdollMove'); Z.WakeUp(); - if(ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo)!=None) + if (ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo)!=None) { ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealth = Min(Z.Health,255); ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealthPercent = FloatToByte(float(Z.Health) / float(Z.HealthMax)); @@ -1021,7 +1021,7 @@ simulated final function InitFPLegs() FPBodyMesh.SetNotifyRigidBodyCollision(false); FPBodyMesh.SetTraceBlocking(false, false); - for(i=0; i0) + if (Health>0) { bOnFirstPerson = !bVisible; - if(AttachedBackItem!=None) + if (AttachedBackItem!=None) AttachedBackItem.SetHidden(bOnFirstPerson); UpdateFPLegs(); } @@ -1046,14 +1046,14 @@ simulated function SetMeshVisibility(bool bVisible) simulated final function UpdateFPLegs() { - if(FPBodyMesh!=None) + if (FPBodyMesh!=None) { - if(!bFPLegsAttached && Physics!=PHYS_RigidBody && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs) + if (!bFPLegsAttached && Physics!=PHYS_RigidBody && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs) { bFPLegsAttached = true; AttachComponent(FPBodyMesh); - if(!bFPLegsInit && CharacterArch!=None) + if (!bFPLegsInit && CharacterArch!=None) InitFPLegs(); } FPBodyMesh.SetHidden(!bOnFirstPerson || !Class'ExtPlayerController'.Default.bShowFPLegs); @@ -1062,7 +1062,7 @@ simulated final function UpdateFPLegs() simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp) { - if(SkelComp==Mesh) // Do not allow first person legs eat up animation slots. + if (SkelComp==Mesh) // Do not allow first person legs eat up animation slots. Super.PostInitAnimTree(SkelComp); } @@ -1075,19 +1075,19 @@ simulated final function SetBackpackWeapon(class WC) local int i; BackpackWeaponClass = WC; - if(WorldInfo.NetMode==NM_DedicatedServer) + if (WorldInfo.NetMode==NM_DedicatedServer) return; - if(WC!=None) + if (WC!=None) { - if(AttachedBackItem==None) + if (AttachedBackItem==None) { AttachedBackItem = new(Self) class'SkeletalMeshComponent'; AttachedBackItem.SetHidden(false); AttachedBackItem.SetLightingChannels(PawnLightingChannel); } AttachedBackItem.SetSkeletalMesh(WC.Default.AttachmentArchetype.SkelMesh); - for(i=0; i WC) MyCharacter = KFPlayerReplicationInfo(PlayerReplicationInfo).CharacterArchetypes[KFPlayerReplicationInfo(PlayerReplicationInfo).RepCustomizationInfo.CharacterIndex]; WM = WC.Default.AttachmentArchetype.SkelMesh.Name; - if(ClassIsChildOf(WC, class'KFWeap_Edged_Knife')) + if (ClassIsChildOf(WC, class'KFWeap_Edged_Knife')) { MyPos = vect(0,0,10); MyRot = rot(-16384,-8192,0); B = 'LeftUpLeg'; } - else if(class(WC) != none || class(WC) != none || class(WC) != none || class(WC) != none || ClassIsChildOf(WC, class'KFWeap_PistolBase') || ClassIsChildOf(WC, class'KFWeap_SMGBase') || ClassIsChildOf(WC, class'KFWeap_ThrownBase')) + else if (class(WC) != none || class(WC) != none || class(WC) != none || class(WC) != none || ClassIsChildOf(WC, class'KFWeap_PistolBase') || ClassIsChildOf(WC, class'KFWeap_SMGBase') || ClassIsChildOf(WC, class'KFWeap_ThrownBase')) { MyPos = vect(0,0,10); MyRot = rot(0,0,16384); B = 'LeftUpLeg'; } - else if(ClassIsChildOf(WC, class'KFWeap_MeleeBase')) + else if (ClassIsChildOf(WC, class'KFWeap_MeleeBase')) { MyPos = vect(-5,15,0); MyRot = rot(0,0,0); - if(class(WC) != none || class(WC) != none) + if (class(WC) != none || class(WC) != none) MyPos.Z = -20; B = 'Spine'; @@ -1125,10 +1125,10 @@ simulated final function SetBackpackWeapon(class WC) MyPos = vect(-18.5,16.5,-18); MyRot = rot(0,0,0); - if(MyCharacter == KFCharacterInfo_Human'CHR_Playable_ARCH.chr_DJSkully_archetype') + if (MyCharacter == KFCharacterInfo_Human'CHR_Playable_ARCH.chr_DJSkully_archetype') MyRot.Roll = 8192; - switch(WM) + switch (WM) { case 'Wep_3rdP_MB500_Rig': MyPos.X = -45; @@ -1153,14 +1153,14 @@ simulated final function SetBackpackWeapon(class WC) Mesh.AttachComponent(AttachedBackItem, B); AttachedBackItem.SetHidden(bOnFirstPerson); } - else if(AttachedBackItem!=None) + else if (AttachedBackItem!=None) AttachedBackItem.SetHidden(true); } simulated function PlayDying(class DamageType, vector HitLoc) { FPBodyMesh.SetHidden(true); - if(AttachedBackItem!=None) + if (AttachedBackItem!=None) AttachedBackItem.SetHidden(true); Super.PlayDying(DamageType,HitLoc); } @@ -1169,7 +1169,7 @@ simulated function SetCharacterAnimationInfo() { Super.SetCharacterAnimationInfo(); - if(!bFPLegsInit && bFPLegsAttached) + if (!bFPLegsInit && bFPLegsAttached) InitFPLegs(); } @@ -1182,11 +1182,11 @@ simulated function SetMeshLightingChannels(LightingChannelContainer NewLightingC FPBodyMesh.SetLightingChannels(NewLightingChannels); } -simulated function PlayWeaponSwitch(Weapon OldWeapon, Weapon NewWeapon) +simulated function PlayWeaponswitch (Weapon OldWeapon, Weapon NewWeapon) { - Super.PlayWeaponSwitch(OldWeapon, NewWeapon); + Super.PlayWeaponswitch (OldWeapon, NewWeapon); - if(WorldInfo.NetMode!=NM_Client) + if (WorldInfo.NetMode!=NM_Client) { PlayerOldWeapon = KFWeapon(OldWeapon); SetBackpackWeapon(PlayerOldWeapon!=None ? PlayerOldWeapon.Class : None); @@ -1198,7 +1198,7 @@ simulated function UpdateHealingSpeedBoostMod(ExtPlayerController Healer) local Ext_PerkFieldMedic MedPerk; MedPerk = GetMedicPerk(Healer); - if(MedPerk == None) + if (MedPerk == None) return; HealingSpeedBoostMod = Min(HealingSpeedBoostMod + MedPerk.GetHealingSpeedBoost(), MedPerk.GetMaxHealingSpeedBoost()); @@ -1217,7 +1217,7 @@ simulated function ResetHealingSpeedBoost() HealingSpeedBoostMod = 0; UpdateGroundSpeed(); - if(IsTimerActive(nameOf(ResetHealingSpeedBoost))) + if (IsTimerActive(nameOf(ResetHealingSpeedBoost))) ClearTimer(nameOf(ResetHealingSpeedBoost)); } @@ -1226,7 +1226,7 @@ simulated function UpdateHealingDamageBoostMod(ExtPlayerController Healer) local Ext_PerkFieldMedic MedPerk; MedPerk = GetMedicPerk(Healer); - if(MedPerk == None) + if (MedPerk == None) return; HealingDamageBoostMod = Min(HealingDamageBoostMod + MedPerk.GetHealingDamageBoost(), MedPerk.GetMaxHealingDamageBoost()); @@ -1241,7 +1241,7 @@ simulated function float GetHealingDamageBoostModifier() simulated function ResetHealingDamageBoost() { HealingDamageBoostMod = 0; - if(IsTimerActive(nameOf(ResetHealingDamageBoost))) + if (IsTimerActive(nameOf(ResetHealingDamageBoost))) ClearTimer(nameOf(ResetHealingDamageBoost)); } @@ -1250,7 +1250,7 @@ simulated function UpdateHealingShieldMod(ExtPlayerController Healer) local Ext_PerkFieldMedic MedPerk; MedPerk = GetMedicPerk(Healer); - if(MedPerk == None) + if (MedPerk == None) return; HealingShieldMod = Min(HealingShieldMod + MedPerk.GetHealingShield(), MedPerk.GetMaxHealingShield()); @@ -1265,7 +1265,7 @@ simulated function float GetHealingShieldModifier() simulated function ResetHealingShield() { HealingShieldMod = 0; - if(IsTimerActive(nameOf(ResetHealingShield))) + if (IsTimerActive(nameOf(ResetHealingShield))) ClearTimer(nameOf(ResetHealingShield)); } @@ -1276,7 +1276,7 @@ function SacrificeExplode() Super.SacrificeExplode(); DemoPerk = Ext_PerkDemolition(ExtPlayerController(Controller).ActivePerkManager.CurrentPerk); - if(DemoPerk != none) + if (DemoPerk != none) DemoPerk.bUsedSacrifice = true; } @@ -1285,7 +1285,7 @@ simulated function Ext_PerkFieldMedic GetMedicPerk(ExtPlayerController Healer) local Ext_PerkFieldMedic MedPerk; MedPerk = Ext_PerkFieldMedic(ExtPlayerController(Controller).ActivePerkManager.CurrentPerk); - if(MedPerk != None) + if (MedPerk != None) return MedPerk; return None; diff --git a/ServerExt/Classes/ExtInventoryManager.uc b/ServerExt/Classes/ExtInventoryManager.uc index 23a667f..0bfa274 100644 --- a/ServerExt/Classes/ExtInventoryManager.uc +++ b/ServerExt/Classes/ExtInventoryManager.uc @@ -6,9 +6,9 @@ var transient byte MoneyTossCount; reliable server function ServerThrowMoney() { - if(MoneyTossTime>WorldInfo.TimeSeconds) + if (MoneyTossTime>WorldInfo.TimeSeconds) { - if(MoneyTossCount>=10) + if (MoneyTossCount>=10) return; ++MoneyTossCount; MoneyTossTime = FMax(MoneyTossTime,WorldInfo.TimeSeconds+0.5); @@ -29,9 +29,9 @@ simulated function Inventory CreateInventory(class NewInventoryItemCl SupClass = Super.CreateInventory(NewInventoryItemClass, bDoNotActivate); Wep = KFWeapon(SupClass); - if(Wep != none) + if (Wep != none) { - if(KFWeap_Pistol_Dual9mm(Wep) != None && ExtWeap_Pistol_Dual9mm(Wep) == None) + if (KFWeap_Pistol_Dual9mm(Wep) != None && ExtWeap_Pistol_Dual9mm(Wep) == None) { Wep.Destroy(); return Super.CreateInventory(class'ExtWeap_Pistol_Dual9mm', bDoNotActivate); @@ -47,7 +47,7 @@ simulated function CheckForExcessRemoval(KFWeapon NewWeap) { local Inventory RemoveInv, Inv; - if(KFWeap_Pistol_Dual9mm(NewWeap) != None) + if (KFWeap_Pistol_Dual9mm(NewWeap) != None) { for (Inv = InventoryChain; Inv != None; Inv = Inv.Inventory) { diff --git a/ServerExt/Classes/ExtMenu_Gear.uc b/ServerExt/Classes/ExtMenu_Gear.uc index 4a3e2e0..6e7c5ee 100644 --- a/ServerExt/Classes/ExtMenu_Gear.uc +++ b/ServerExt/Classes/ExtMenu_Gear.uc @@ -25,11 +25,11 @@ function InitCharacterMenu() { ExtPRI = ExtPlayerReplicationInfo(GetPC().PlayerReplicationInfo); - if(ExtPRI!=None && ExtPRI.bClientInitChars) + if (ExtPRI!=None && ExtPRI.bClientInitChars) CharListRecieved(); - else if(ExtPRI==None) + else if (ExtPRI==None) { - if(GetPC().PlayerReplicationInfo!=None) // Faulty mod setup. + if (GetPC().PlayerReplicationInfo!=None) // Faulty mod setup. { bWaitingCharList = true; return; @@ -45,7 +45,7 @@ function InitCharacterMenu() event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget) { - switch(WidgetName) + switch (WidgetName) { case 'perkSelectionContainer': if (PerkSelectionContainer == none) @@ -64,7 +64,7 @@ function OnOpen() local PlayerController PC; PC = GetPC(); - if(PC == none) + if (PC == none) return; CheckForCustomizationPawn(PC); @@ -82,10 +82,10 @@ function CheckForCustomizationPawn(PlayerController PC) { local KFPlayerController KFPC; - if(PC.Pawn == None || (!PC.Pawn.IsAliveAndWell() && KFPawn_Customization(PC.Pawn) == None)) + if (PC.Pawn == None || (!PC.Pawn.IsAliveAndWell() && KFPawn_Customization(PC.Pawn) == None)) { KFPC = KFPlayerController(PC); - if(KFPC != None) + if (KFPC != None) { KFPC.SpawnMidGameCustomizationPawn(); } @@ -157,7 +157,7 @@ function UpdateCharacterList() bWaitingCharList = false; ItemIndex = 0; DataProvider = CreateArray(); - for(i=0; i Outfit = Outfits[i]; OutfitName = Localize(CharInfoPath, OutfitKey$i, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString); - if(bIsCustomChar) + if (bIsCustomChar) OutfitName = GetMenuNameStr(Outfit.MeshName); if (InStr(OutfitName, "?INT?") != -1) @@ -247,7 +247,7 @@ function UpdateMeshList(string OutfitKey, string SkinKey, array SlotObject.SetString("label", OutfitName); SlotObject.SetBool("enabled", true); FirstSkin = UpdateOutfitVariants(OutfitKey, SkinKey, Outfit.SkinVariations, i, SlotObject); - if(string(FirstSkin.UITexture) == "Bad") + if (string(FirstSkin.UITexture) == "Bad") continue; TexturePath = "img://"$PathName(FirstSkin.UITexture); @@ -277,7 +277,7 @@ function SkinVariant UpdateOutfitVariants(string OutfitKey, string KeyName, out for (i = 0; i < SkinVariations.length; i++) { Skin = SkinVariations[i]; - if(!bFoundFirst) + if (!bFoundFirst) { FirstSkin = Skin; bFoundFirst = true; @@ -358,7 +358,7 @@ function SkinVariant UpdateCosmeticVariants(string OutfitKey, string KeyName, KF for (i = 0; i < Attachment.SkinVariations.length; i++) { Skin = Attachment.SkinVariations[i]; - if(!bFoundFirst) + if (!bFoundFirst) { FirstSkin = Skin; bFoundFirst = true; @@ -393,7 +393,7 @@ function SetCurrentCharacterButtons() HeadSkinIndex = ExtPRI.RepCustomizationInfo.HeadSkinIndex; BodyMeshIndex = ExtPRI.RepCustomizationInfo.BodyMeshIndex; BodySkinIndex = ExtPRI.RepCustomizationInfo.BodySkinIndex; - if(bCustom) + if (bCustom) { CharacterIndex = ExtPRI.CustomCharacter.CharacterIndex; HeadMeshIndex = ExtPRI.CustomCharacter.HeadMeshIndex; @@ -426,7 +426,7 @@ function SetEmoteButton() EmoteIndex = class'ExtEmoteList'.static.GetEmoteIndex(class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(GetPC()))); DataObject = CreateObject("Object"); - if(EmoteIndex == 255) + if (EmoteIndex == 255) { DataObject.SetString("selectedEmote", ""); DataObject.SetInt("selectedEmoteIndex", 0); @@ -449,18 +449,18 @@ function SetGearButtons(int MeshIndex, int SkinIndex, string MeshKey, string Ski local string SkinName, MeshName; local GFxObject DataObject; - if(bWaitingCharList) + if (bWaitingCharList) return; DataObject = CreateObject("Object"); - if(MeshIndex == `CLEARED_ATTACHMENT_INDEX) + if (MeshIndex == `CLEARED_ATTACHMENT_INDEX) { DataObject.SetString(sectionFunctionName, class'KFGFxMenu_Gear'.Default.NoneString); } - else if(bIsCustomChar) + else if (bIsCustomChar) { - if(MeshKey==class'KFGFxMenu_Gear'.Default.HeadMeshKey) + if (MeshKey==class'KFGFxMenu_Gear'.Default.HeadMeshKey) { SkinName = GetMenuName(CurrentCharInfo.HeadVariants[MeshIndex].SkinVariations[SkinIndex].Skin); MeshName = GetMenuNameStr(CurrentCharInfo.HeadVariants[MeshIndex].MeshName); @@ -496,16 +496,16 @@ function SetAttachmentButtons(string AttachmentMeshKey, string sectionFunctionNa local int i, AttachmentIndex; local bool bCustom; - if(bWaitingCharList) + if (bWaitingCharList) return; bCustom = ExtPRI.UsesCustomChar(); DataObject = CreateObject("Object"); - for(i = 0; i < `MAX_COSMETIC_ATTACHMENTS; i++) + for (i = 0; i < `MAX_COSMETIC_ATTACHMENTS; i++) { AttachmentIndex = bCustom ? ExtPRI.CustomCharacter.AttachmentMeshIndices[i] : ExtPRI.RepCustomizationInfo.AttachmentMeshIndices[i]; - if(AttachmentIndex == `CLEARED_ATTACHMENT_INDEX) + if (AttachmentIndex == `CLEARED_ATTACHMENT_INDEX) { DataObject.SetString("selectedAttachment_"$i, "----"); } @@ -533,7 +533,7 @@ event OnClose() // If we are alive, in game, with a playable pawn. switch back to first person view when leaving this menu PC = GetPC(); - if(PC != none && PC.WorldInfo.GRI.bMatchHasBegun && PC.Pawn != none && !PC.Pawn.IsA('KFPawn_Customization')) + if (PC != none && PC.WorldInfo.GRI.bMatchHasBegun && PC.Pawn != none && !PC.Pawn.IsA('KFPawn_Customization')) { PC.ServerCamera('FirstPerson'); } @@ -560,7 +560,7 @@ function Callback_Emote(int Index) local KFPlayerController KFPC; KFPC = KFPlayerController(GetPC()); - if(KFPC != none) + if (KFPC != none) { class'ExtEmoteList'.static.SaveEquippedEmote(EmoteList[Index].ID, ExtPlayerController(KFPC)); @@ -596,7 +596,7 @@ function Callback_Weapon(int ItemIndex, int SkinIndex) local KFPawn_Customization KFP; KFP = KFPawn_Customization(GetPC().Pawn); - if(KFP != none) + if (KFP != none) KFP.AttachWeaponByItemDefinition(SkinIndex); } @@ -620,7 +620,7 @@ function Callback_Character(int Index) function Callback_Head(int MeshIndex, int SkinIndex) { - if(!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server. + if (!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server. ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true); ExtPRI.UpdateCustomization(CO_Head, MeshIndex, SkinIndex); SetGearButtons(MeshIndex, SkinIndex, class'KFGFxMenu_Gear'.Default.HeadMeshKey, class'KFGFxMenu_Gear'.Default.HeadSkinKey, class'KFGFxMenu_Gear'.Default.HeadFunctionKey); @@ -628,7 +628,7 @@ function Callback_Head(int MeshIndex, int SkinIndex) function Callback_Body(int MeshIndex, int SkinIndex) { - if(!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server. + if (!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server. ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true); ExtPRI.UpdateCustomization(CO_Body, MeshIndex, SkinIndex); @@ -646,19 +646,19 @@ function Callback_Attachment(int MeshIndex, int SkinIndex) local int SlotIndex; local KFPawn KFP; - if(!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server. + if (!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server. ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true); KFP = KFPawn(GetPC().Pawn); - if(KFP!=None && ExtPRI!=None) + if (KFP!=None && ExtPRI!=None) { - if(MeshIndex==`CLEARED_ATTACHMENT_INDEX) + if (MeshIndex==`CLEARED_ATTACHMENT_INDEX) ExtPRI.RemoveAttachments(); else { class'ExtCharacterInfo'.Static.DetachConflictingAttachments(CurrentCharInfo, MeshIndex, KFP, ExtPRI); SlotIndex = class'ExtCharacterInfo'.Static.GetAttachmentSlotIndex(CurrentCharInfo, MeshIndex, KFP, ExtPRI); - if(SlotIndex == INDEX_NONE) + if (SlotIndex == INDEX_NONE) { return; } diff --git a/ServerExt/Classes/ExtMenu_Inventory.uc b/ServerExt/Classes/ExtMenu_Inventory.uc index 4d90f96..5cf1565 100644 --- a/ServerExt/Classes/ExtMenu_Inventory.uc +++ b/ServerExt/Classes/ExtMenu_Inventory.uc @@ -7,14 +7,14 @@ function bool IsItemActive(int ItemDefinition) ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition); - if(ItemIndex == INDEX_NONE) + if (ItemIndex == INDEX_NONE) { return false; } WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef; - if(WeaponDef != none) + if (WeaponDef != none) { return class'ExtWeaponSkinList'.Static.IsSkinEquip(WeaponDef, ItemDefinition, ExtPlayerController(KFPC)); } @@ -29,20 +29,20 @@ function Callback_Equip(int ItemDefinition) ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition); - if(ItemIndex == INDEX_NONE) + if (ItemIndex == INDEX_NONE) { return; } WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef; - if(WeaponDef != none) + if (WeaponDef != none) { - if(IsItemActive(ItemDefinition)) + if (IsItemActive(ItemDefinition)) { class'ExtWeaponSkinList'.Static.SaveWeaponSkin(WeaponDef, 0, ExtPlayerController(KFPC)); - if(class'WorldInfo'.static.IsConsoleBuild()) + if (class'WorldInfo'.static.IsConsoleBuild()) { Manager.CachedProfile.ClearWeaponSkin(WeaponDef.default.WeaponClassPath); } @@ -50,7 +50,7 @@ function Callback_Equip(int ItemDefinition) else { class'ExtWeaponSkinList'.Static.SaveWeaponSkin(WeaponDef, ItemDefinition, ExtPlayerController(KFPC)); - if(class'WorldInfo'.static.IsConsoleBuild()) + if (class'WorldInfo'.static.IsConsoleBuild()) { Manager.CachedProfile.SaveWeaponSkin(WeaponDef.default.WeaponClassPath, ItemDefinition); } diff --git a/ServerExt/Classes/ExtMenu_Perks.uc b/ServerExt/Classes/ExtMenu_Perks.uc index 47958a4..140960f 100644 --- a/ServerExt/Classes/ExtMenu_Perks.uc +++ b/ServerExt/Classes/ExtMenu_Perks.uc @@ -6,17 +6,17 @@ var Ext_PerkBase ExtPrevPerk; function OnOpen() { KFPC = KFPlayerController(GetPC()); - if(ExtKFPC == none) + if (ExtKFPC == none) ExtKFPC = ExtPlayerController(KFPC); - if(ExtKFPC.ActivePerkManager==None) + if (ExtKFPC.ActivePerkManager==None) { ExtKFPC.SetTimer(0.25,true,'OnOpen',Self); return; } ExtKFPC.ClearTimer('OnOpen',Self); - if(ExtPrevPerk==None) + if (ExtPrevPerk==None) ExtPrevPerk = ExtKFPC.ActivePerkManager.CurrentPerk; ExUpdateContainers(ExtPrevPerk); @@ -53,7 +53,7 @@ function PerkChanged(byte NewPerkIndex, bool bClickedIndex) function OneSecondLoop() { - if(ExtPrevPerk!=None && LastPerkLevel!=ExtPrevPerk.CurrentLevel) + if (ExtPrevPerk!=None && LastPerkLevel!=ExtPrevPerk.CurrentLevel) ExUpdateContainers(ExtPrevPerk); } diff --git a/ServerExt/Classes/ExtMenu_Trader.uc b/ServerExt/Classes/ExtMenu_Trader.uc index 768d208..0b31528 100644 --- a/ServerExt/Classes/ExtMenu_Trader.uc +++ b/ServerExt/Classes/ExtMenu_Trader.uc @@ -14,11 +14,11 @@ function int GetPerkIndex() } function UpdatePlayerInfo() { - if(ExtKFPC != none && PlayerInfoContainer != none) + if (ExtKFPC != none && PlayerInfoContainer != none) { PlayerInfoContainer.SetPerkInfo(); PlayerInfoContainer.SetPerkList(); - if(ExtKFPC.ActivePerkManager!=None && ExtKFPC.ActivePerkManager.CurrentPerk!=ExLastPerkClass) + if (ExtKFPC.ActivePerkManager!=None && ExtKFPC.ActivePerkManager.CurrentPerk!=ExLastPerkClass) { ExLastPerkClass = ExtKFPC.ActivePerkManager.CurrentPerk; OnPerkChanged(GetPerkIndex()); @@ -33,7 +33,7 @@ function Callback_PerkChanged(int PerkIndex) ExtKFPC.PendingPerkClass = ExtKFPC.ActivePerkManager.UserPerks[PerkIndex].Class; ExtKFPC.SwitchToPerk(ExtKFPC.PendingPerkClass); - if(PlayerInventoryContainer != none) + if (PlayerInventoryContainer != none) { PlayerInventoryContainer.UpdateLock(); } diff --git a/ServerExt/Classes/ExtMoviePlayer_HUD.uc b/ServerExt/Classes/ExtMoviePlayer_HUD.uc index 83733d1..0f2c4a4 100644 --- a/ServerExt/Classes/ExtMoviePlayer_HUD.uc +++ b/ServerExt/Classes/ExtMoviePlayer_HUD.uc @@ -5,7 +5,7 @@ function TickHud(float DeltaTime) local PlayerController PC; PC = GetPC(); - if(PC!=none && PC.PlayerInput!=None) + if (PC!=none && PC.PlayerInput!=None) Super.TickHud(DeltaTime); } @@ -16,14 +16,14 @@ final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInf local string KilledName, KillerName, KilledIconpath, KillerIconPath; local string KillerTextColor, KilledTextColor; - if(KFPC == none) + if (KFPC == none) return; - if(KFGXHUDManager != none) + if (KFGXHUDManager != none) { - if(PawnOther != none) + if (PawnOther != none) { - if(bDeathMessage) + if (bDeathMessage) { KillerTextColor = ZEDTeamTextColor; KillerName = class'KFExtendedHUD'.Static.GetNameOf(PawnOther); @@ -34,9 +34,9 @@ final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInf bHumanDeath = false; } } - if((PawnOther==None || !bDeathMessage) && PRI1 != none) + if ((PawnOther==None || !bDeathMessage) && PRI1 != none) { - if(PRI1.GetTeamNum() == 255) + if (PRI1.GetTeamNum() == 255) { KillerTextColor = ZEDTeamTextColor; KillerIconpath = "img://"$class'KFPerk_Monster'.static.GetPerkIconPath(); @@ -44,15 +44,15 @@ final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInf else { KillerTextColor = HumanTeamTextColor; - if(ExtPlayerReplicationInfo(PRI1)!=None && ExtPlayerReplicationInfo(PRI1).ECurrentPerk!=None) + if (ExtPlayerReplicationInfo(PRI1)!=None && ExtPlayerReplicationInfo(PRI1).ECurrentPerk!=None) KillerIconpath = ExtPlayerReplicationInfo(PRI1).ECurrentPerk.static.GetPerkIconPath(0); } KillerName = PRI1.PlayerName; } - if(PRI2 != none) + if (PRI2 != none) { - if(PRI2.GetTeamNum() == class'KFTeamInfo_Human'.default.TeamIndex) + if (PRI2.GetTeamNum() == class'KFTeamInfo_Human'.default.TeamIndex) { bHumanDeath = true; KilledTextColor = HumanTeamTextColor; @@ -63,10 +63,10 @@ final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInf bHumanDeath = false; } KilledName = PRI2.PlayerName; - if(ExtPlayerReplicationInfo(PRI2)!=None && ExtPlayerReplicationInfo(PRI2).ECurrentPerk!=None) + if (ExtPlayerReplicationInfo(PRI2)!=None && ExtPlayerReplicationInfo(PRI2).ECurrentPerk!=None) KilledIconpath = ExtPlayerReplicationInfo(PRI2).ECurrentPerk.static.GetPerkIconPath(0); } - else if(VictimStr!="") + else if (VictimStr!="") { KilledTextColor = HumanTeamTextColor; KilledIconpath = "img://"$class'KFPerk_Monster'.static.GetPerkIconPath(); diff --git a/ServerExt/Classes/ExtMoviePlayer_Manager.uc b/ServerExt/Classes/ExtMoviePlayer_Manager.uc index 6b0fe98..4b7373e 100644 --- a/ServerExt/Classes/ExtMoviePlayer_Manager.uc +++ b/ServerExt/Classes/ExtMoviePlayer_Manager.uc @@ -11,7 +11,7 @@ event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget) { case 'gearMenu': PC = GetPC(); - if(PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun) + if (PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun) return true; if (EGearMenu == none) { @@ -35,13 +35,13 @@ function LaunchMenus(optional bool bForceSkipLobby) WidgetBinding.WidgetClass = class'ExtWidget_PartyInGame'; ManagerObject.SetBool("backgroundVisible", false); ManagerObject.SetBool("IISMovieVisible", false); - if(bSkippedLobby) + if (bSkippedLobby) CurrentBackgroundMovie.Stop(); WidgetBindings.AddItem(WidgetBinding); // Load the platform-specific graphics options menu - switch(class'KFGameEngine'.static.GetPlatform()) + switch (class'KFGameEngine'.static.GetPlatform()) { case PLATFORM_PC_DX10: WidgetBinding.WidgetName = 'optionsGraphicsMenu'; @@ -62,7 +62,7 @@ function LaunchMenus(optional bool bForceSkipLobby) } // do this stuff in case CheckSkipLobby failed - if(bForceSkipLobby) + if (bForceSkipLobby) { bAfterLobby = true; CloseMenus(true); @@ -77,10 +77,10 @@ function OpenMenu(byte NewMenuIndex, optional bool bShowWidgets = true) Super.OpenMenu(NewMenuIndex, bShowWidgets); - if(bAfterLobby) + if (bAfterLobby) return; - if(NewMenuIndex == UI_Perks) + if (NewMenuIndex == UI_Perks) { PerksPage = GUIController.OpenMenu(class'ExtGUI_PerkSelectionPage'); SetMovieCanReceiveInput(false); @@ -93,7 +93,7 @@ function CloseMenus(optional bool bForceClose=false) { local KF2GUIController GUIController; - if(PerksPage != None) + if (PerksPage != None) { GUIController = class'KF2GUIController'.Static.GetGUIController(GetPC()); GUIController.CloseMenu(class'ExtGUI_PerkSelectionPage'); @@ -106,7 +106,7 @@ function OnMenuOpen(name WidgetPath, KFGFxObject_Menu Widget) { Super.OnMenuOpen(WidgetPath, Widget); - if(!bAfterLobby && Widget == PerksMenu) + if (!bAfterLobby && Widget == PerksMenu) PerksMenu.ActionScriptVoid("closeContainer"); } diff --git a/ServerExt/Classes/ExtPawn_Customization.uc b/ServerExt/Classes/ExtPawn_Customization.uc index fc11215..a92b602 100644 --- a/ServerExt/Classes/ExtPawn_Customization.uc +++ b/ServerExt/Classes/ExtPawn_Customization.uc @@ -2,7 +2,7 @@ class ExtPawn_Customization extends KFPawn_Customization; simulated function KFCharacterInfoBase GetCharacterInfo() { - if(ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) + if (ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch(); return Super.GetCharacterInfo(); } @@ -35,9 +35,9 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor } } - if(CharacterArch != none) + if (CharacterArch != none) { - if(CharacterArch.VoiceGroupArchName != "") + if (CharacterArch.VoiceGroupArchName != "") VoiceGroupArch = class(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class')); } } @@ -74,7 +74,7 @@ function AttachWeaponByItemDefinition(int ItemDefinition) //find weapon def ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition); - if(ItemIndex == INDEX_NONE) + if (ItemIndex == INDEX_NONE) { `log("Could not find item" @ItemDefinition); return; @@ -82,7 +82,7 @@ function AttachWeaponByItemDefinition(int ItemDefinition) WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef; - if(WeaponDef == none) + if (WeaponDef == none) { `log("Weapon def NONE for : " @ItemDefinition); return; diff --git a/ServerExt/Classes/ExtPerkManager.uc b/ServerExt/Classes/ExtPerkManager.uc index 977c88f..9970ac5 100644 --- a/ServerExt/Classes/ExtPerkManager.uc +++ b/ServerExt/Classes/ExtPerkManager.uc @@ -43,7 +43,7 @@ replication final function SetGrenadeCap(byte AddedCap) { MaxGrenadeCount = Default.MaxGrenadeCount + AddedCap; - if(RepState==REP_Done) + if (RepState==REP_Done) ClientSetGrenadeCap(MaxGrenadeCount); } simulated reliable client function ClientSetGrenadeCap(byte NewCap) @@ -55,8 +55,8 @@ function bool ApplyPerkClass(class P) { local int i; - for(i=0; i HP.HealthMax) HP.Health = HP.HealthMax; - if(HP.Armor > HP.MaxArmor) HP.Armor = HP.MaxArmor; + if (HP.Health > HP.HealthMax) HP.Health = HP.HealthMax; + if (HP.Armor > HP.MaxArmor) HP.Armor = HP.MaxArmor; } } } @@ -146,8 +146,8 @@ simulated final function Ext_PerkBase FindPerk(class P) { local int i; - for(i=0; i P) simulated function PostBeginPlay() { SetTimer(0.01,false,'InitPerks'); - if(WorldInfo.NetMode!=NM_Client) + if (WorldInfo.NetMode!=NM_Client) SetTimer(1,true,'CheckPlayTime'); } @@ -163,18 +163,18 @@ simulated function InitPerks() { local Ext_PerkBase P; - if(WorldInfo.NetMode==NM_Client) + if (WorldInfo.NetMode==NM_Client) { foreach DynamicActors(class'Ext_PerkBase',P) - if(P.PerkManager!=Self) + if (P.PerkManager!=Self) RegisterPerk(P); } - else if(PRIOwner!=PlayerOwner.PlayerReplicationInfo) // See if was assigned an inactive PRI. + else if (PRIOwner!=PlayerOwner.PlayerReplicationInfo) // See if was assigned an inactive PRI. { PRIOwner = ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo); - if(PRIOwner!=None) + if (PRIOwner!=None) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) { PRIOwner.ECurrentPerk = CurrentPerk.Class; CurrentPerk.UpdatePRILevel(); @@ -194,13 +194,13 @@ function ServerInitPerks() { local int i; - for(i=0; i=0; --i) + for (i=(UserPerks.Length-1); i>=0; --i) { UserPerks[i].PerkManager = None; UserPerks[i].Destroy(); @@ -229,25 +229,25 @@ function Destroyed() function EarnedEXP(int EXP, optional byte Mode) { // `log("EarnedEXP" @ GetScriptTrace()); - if(CurrentPerk!=None) + if (CurrentPerk!=None) { // Limit how much EXP we got for healing and welding. - switch(Mode) + switch (Mode) { case 1: ExpUpStatus[0]+=EXP; EXP = ExpUpStatus[0]/CurrentPerk.WeldExpUpNum; - if(EXP>0) + if (EXP>0) ExpUpStatus[0]-=(EXP*CurrentPerk.WeldExpUpNum); break; case 2: ExpUpStatus[1]+=EXP; EXP = ExpUpStatus[1]/CurrentPerk.HealExpUpNum; - if(EXP>0) + if (EXP>0) ExpUpStatus[1]-=(EXP*CurrentPerk.HealExpUpNum); break; } - if(EXP>0 && CurrentPerk.EarnedEXP(EXP)) + if (EXP>0 && CurrentPerk.EarnedEXP(EXP)) { TotalEXP+=EXP; PRIOwner.RepEXP+=EXP; @@ -268,13 +268,13 @@ function OutputXML(ExtStatWriter Data) Data.WriteValue("exp",string(TotalEXP)); Data.WriteValue("kills",string(TotalKills)); Data.WriteValue("time",string(TotalPlayTime)); - if(ExtPlayerController(Owner)!=None && ExtPlayerController(Owner).PendingPerkClass!=None) + if (ExtPlayerController(Owner)!=None && ExtPlayerController(Owner).PendingPerkClass!=None) S = string(ExtPlayerController(Owner).PendingPerkClass.Name); else S = (CurrentPerk!=None ? string(CurrentPerk.Class.Name) : "None"); Data.WriteValue("activeperk",S); - for(i=0; i=PRIOwner.CustomCharList.Length) + if (RepIndex>=PRIOwner.CustomCharList.Length) { PRIOwner.AllCharReceived(); RepIndex = 0; @@ -433,7 +433,7 @@ function ReplicateTimer() } break; case REP_CustomInventory: // Replicate custom trader inventory - if(!PRIOwner.OnRepNextItem(PRIOwner,RepIndex)) + if (!PRIOwner.OnRepNextItem(PRIOwner,RepIndex)) { RepIndex = 0; ++RepState; @@ -441,20 +441,20 @@ function ReplicateTimer() else ++RepIndex; break; case REP_PerkClasses: // Open up all actor channel connections. - if(RepIndex>=UserPerks.Length) + if (RepIndex>=UserPerks.Length) { RepIndex = 0; ++RepState; } - else if(UserPerks[RepIndex].bClientAuthorized) + else if (UserPerks[RepIndex].bClientAuthorized) { - if(UserPerks[RepIndex].bPerkNetReady) + if (UserPerks[RepIndex].bPerkNetReady) ++RepIndex; } else { UserPerks[RepIndex].RemoteRole = ROLE_SimulatedProxy; - if(UserPerks[RepIndex].NextAuthTime DT) simulated function ModifySpeed(out float Speed) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) Speed *= CurrentPerk.Modifiers[0]; } function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyDamageGiven(InDamage,DamageCauser,MyKFPM,DamageInstigator,DamageType,HitZoneIdx); } simulated function ModifyDamageTaken(out int InDamage, optional class DamageType, optional Controller InstigatedBy) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyDamageTaken(InDamage,DamageType,InstigatedBy); } simulated function ModifyRecoil(out float CurrentRecoilModifier, KFWeapon KFW) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyRecoil(CurrentRecoilModifier,KFW); } simulated function ModifySpread(out float InSpread) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifySpread(InSpread); } simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyRateOfFire(InRate,KFW); } simulated function float GetReloadRateScale(KFWeapon KFW) @@ -513,12 +513,12 @@ simulated function bool GetUsingTactialReload(KFWeapon KFW) } function ModifyHealth(out int InHealth) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyHealth(InHealth); } function ModifyArmor(out byte MaxArmor) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyArmor(MaxArmor); } function float GetKnockdownPowerModifier(optional class DamageType, optional byte BodyPart, optional bool bIsSprinting=false) @@ -535,7 +535,7 @@ function float GetStunPowerModifier(optional class DamageType, optio } simulated function ModifyMeleeAttackSpeed(out float InDuration, KFWeapon KFW) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyMeleeAttackSpeed(InDuration); } simulated function class GetGrenadeClass() @@ -544,7 +544,7 @@ simulated function class GetGrenadeClass() } simulated function ModifyWeldingRate(out float FastenRate, out float UnfastenRate) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyWeldingRate(FastenRate,UnfastenRate); } simulated function bool HasNightVision() @@ -565,17 +565,17 @@ function bool CanNotBeGrabbed() } simulated function ModifyMagSizeAndNumber(KFWeapon KFW, out int MagazineCapacity, optional array< Class > WeaponPerkClass, optional bool bSecondary=false, optional name WeaponClassname) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyMagSizeAndNumber(KFW,MagazineCapacity,WeaponPerkClass,bSecondary,WeaponClassname); } simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary=false) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifySpareAmmoAmount(KFW,PrimarySpareAmmo,TraderItem,bSecondary); } simulated function ModifyMaxSpareAmmoAmount(KFWeapon KFW, out int SpareAmmoCapacity, optional const out STraderItem TraderItem, optional bool bSecondary=false) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifySpareAmmoAmount(KFW,SpareAmmoCapacity,TraderItem,bSecondary); } simulated function bool ShouldMagSizeModifySpareAmmo(KFWeapon KFW, optional Class WeaponPerkClass) @@ -584,7 +584,7 @@ simulated function bool ShouldMagSizeModifySpareAmmo(KFWeapon KFW, optional Clas } simulated function ModifyHealerRechargeTime(out float RechargeRate) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyHealerRechargeTime(RechargeRate); } simulated function bool CanExplosiveWeld() @@ -597,7 +597,7 @@ simulated function bool IsOnContactActive() } function bool CanSpreadNapalm() { - if(CurrentPerk!=None && CurrentPerk.bNapalmFire && LastNapalmTime!=WorldInfo.TimeSeconds) + if (CurrentPerk!=None && CurrentPerk.bNapalmFire && LastNapalmTime!=WorldInfo.TimeSeconds) { LastNapalmTime = WorldInfo.TimeSeconds; // Avoid infinite script recursion in KFPawn_Monster. return true; @@ -610,17 +610,17 @@ simulated function bool IsRangeActive() } simulated function DrawSpecialPerkHUD(Canvas C) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.DrawSpecialPerkHUD(C); } function PlayerKilled(KFPawn_Monster Victim, class DamageType) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.PlayerKilled(Victim,DamageType); } function ModifyBloatBileDoT(out float DoTScaler) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.ModifyBloatBileDoT(DoTScaler); } simulated function bool GetIsUberAmmoActive(KFWeapon KFW) @@ -629,12 +629,12 @@ simulated function bool GetIsUberAmmoActive(KFWeapon KFW) } function UpdatePerkHeadShots(ImpactInfo Impact, class DamageType, int NumHit) { - if(CurrentPerk!=None) + if (CurrentPerk!=None) CurrentPerk.UpdatePerkHeadShots(Impact,DamageType,NumHit); } function CheckForAirborneAgent(KFPawn HealTarget, class DamType, int HealAmount) { - if(!bCurrentlyHealing && CurrentPerk!=None) + if (!bCurrentlyHealing && CurrentPerk!=None) { // Using boolean to avoid infinite recursion. bCurrentlyHealing = true; @@ -654,7 +654,7 @@ function bool IsAcidicCompoundActive() } function ModifyACDamage(out int InDamage) { - if(CurrentPerk!=None && CurrentPerk.bToxicDart) + if (CurrentPerk!=None && CurrentPerk.bToxicDart) InDamage += CurrentPerk.ToxicDartDamage; } @@ -723,7 +723,7 @@ simulated function bool ShouldNeverDud() } function NotifyPerkSacrificeExploded() { - if(Ext_PerkDemolition(CurrentPerk) != none) Ext_PerkDemolition(CurrentPerk).bUsedSacrifice = true; + if (Ext_PerkDemolition(CurrentPerk) != none) Ext_PerkDemolition(CurrentPerk).bUsedSacrifice = true; } simulated function float GetAoERadiusModifier() { @@ -777,12 +777,12 @@ simulated function float GetPenetrationModifier(byte Level, class // Other function ApplySkillsToPawn() { - if(CheckOwnerPawn()) + if (CheckOwnerPawn()) { OwnerPawn.UpdateGroundSpeed(); OwnerPawn.bMovesFastInZedTime = false; - if(MyPRI == none) + if (MyPRI == none) MyPRI = KFPlayerReplicationInfo(OwnerPawn.PlayerReplicationInfo); ApplyWeightLimits(); diff --git a/ServerExt/Classes/ExtPerksContainer_Details.uc b/ServerExt/Classes/ExtPerksContainer_Details.uc index ac7725a..1999533 100644 --- a/ServerExt/Classes/ExtPerksContainer_Details.uc +++ b/ServerExt/Classes/ExtPerksContainer_Details.uc @@ -1,6 +1,6 @@ class ExtPerksContainer_Details extends KFGFxPerksContainer_Details; -`define AddWeaponsInfo(InClassDef) if(`InClassDef!=None) AddWeaponInfo(WeaponNames, WeaponSources, `InClassDef.static.GetItemName(), `InClassDef.static.GetImagePath()) +`define AddWeaponsInfo(InClassDef) if (`InClassDef!=None) AddWeaponInfo(WeaponNames, WeaponSources, `InClassDef.static.GetItemName(), `InClassDef.static.GetImagePath()) final function ExUpdateDetails(Ext_PerkBase PerkClass) { @@ -21,7 +21,7 @@ final function ExUpdateDetails(Ext_PerkBase PerkClass) DetailsProvider.SetString("ExperienceMessage", ExperienceString @ PerkClass.CurrentEXP); - if(KFGRI != none) + if (KFGRI != none) { `AddWeaponsInfo(PerkClass.PrimaryWeaponDef); `AddWeaponsInfo(PerkClass.SecondaryWeaponDef); @@ -49,7 +49,7 @@ final function ExUpdatePassives(Ext_PerkBase PerkClass) local int i; PassivesProvider = CreateArray(); - for(i=0; i Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject) { - if(Message!=class'KFLocalMessage_PlayerKills' && (Message!=class'KFLocalMessage_Game' || (Switch!=KMT_Suicide && Switch!=KMT_Killed))) + if (Message!=class'KFLocalMessage_PlayerKills' && (Message!=class'KFLocalMessage_Game' || (Switch!=KMT_Suicide && Switch!=KMT_Killed))) Super.ReceiveLocalizedMessage(Message,Switch,RelatedPRI_1,RelatedPRI_2,OptionalObject); } function AddZedKill(class MonsterClass, byte Difficulty, class DT, bool bKiller) { // Stats. - if(ActivePerkManager!=None) + if (ActivePerkManager!=None) { ActivePerkManager.TotalKills++; ActivePerkManager.PRIOwner.RepKills++; @@ -156,13 +156,13 @@ function AddZedKill(class MonsterClass, byte Difficulty, classWorldInfo.TimeSeconds) + if (LastMisfireTime>WorldInfo.TimeSeconds) { - if(++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f) + if (++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f) NotifyFixed(8); LastMisfireTime = WorldInfo.TimeSeconds+2.f; return; @@ -206,11 +206,11 @@ function AddShotsHit(int AddedHits) MisfireTimer = WorldInfo.TimeSeconds; return; } - if(!W.HasAmmo(W.CurrentFireMode)) + if (!W.HasAmmo(W.CurrentFireMode)) { - if(LastMisfireTime>WorldInfo.TimeSeconds) + if (LastMisfireTime>WorldInfo.TimeSeconds) { - if(++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f) + if (++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f) NotifyFixed(16); LastMisfireTime = WorldInfo.TimeSeconds+2.f; return; @@ -222,19 +222,19 @@ function AddShotsHit(int AddedHits) } T = W.GetFireInterval(W.CurrentFireMode); ActivePerkManager.ModifyRateOfFire(T,W); - if((WorldInfo.TimeSeconds-LastFireTime)<(T*0.5) || !W.IsFiring()) + if ((WorldInfo.TimeSeconds-LastFireTime)<(T*0.5) || !W.IsFiring()) { - if((WorldInfo.TimeSeconds-LastFireTime)>4.f) + if ((WorldInfo.TimeSeconds-LastFireTime)>4.f) MisrateCounter = 0; LastFireTime = WorldInfo.TimeSeconds; - if(MisrateCounter<5) + if (MisrateCounter<5) { ++MisrateCounter; return; } - if(LastMisfireTime>WorldInfo.TimeSeconds) + if (LastMisfireTime>WorldInfo.TimeSeconds) { - if(++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f) + if (++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f) NotifyFixed(2); LastMisfireTime = WorldInfo.TimeSeconds+1.f; return; @@ -256,7 +256,7 @@ reliable client function ReceiveServerMOTD(string S, bool bFinal) reliable server function ServerSetMOTD(string S, bool bFinal) { PendingMOTD $= S; - if(bFinal && PendingMOTD!="") + if (bFinal && PendingMOTD!="") { OnSetMOTD(Self,PendingMOTD); PendingMOTD = ""; @@ -266,7 +266,7 @@ reliable server function ServerSetMOTD(string S, bool bFinal) // TESTING: reliable server function ServerItemDropGet(string Item) { - if(DropCount>5 || Len(Item)>100) + if (DropCount>5 || Len(Item)>100) return; ++DropCount; WorldInfo.Game.Broadcast(Self,PlayerReplicationInfo.GetHumanReadableName()$" got item: "$Item); @@ -274,56 +274,56 @@ reliable server function ServerItemDropGet(string Item) reliable client function ReceiveLevelUp(Ext_PerkBase Perk, int NewLevel) { - if(Perk!=None) + if (Perk!=None) MyGFxHUD.LevelUpNotificationWidget.ShowAchievementNotification(class'KFGFxWidget_LevelUpNotification'.Default.LevelUpString, Perk.PerkName, class'KFGFxWidget_LevelUpNotification'.Default.TierUnlockedString, Perk.GetPerkIconPath(NewLevel), false, NewLevel); } reliable client function ReceiveKillMessage(class Victim, optional bool bGlobal, optional PlayerReplicationInfo KillerPRI) { - if(bHideKillMsg || (bGlobal && KillerPRI==None)) + if (bHideKillMsg || (bGlobal && KillerPRI==None)) return; - if(bUseKF2KillMessages) + if (bUseKF2KillMessages) { - if(MyGFxHUD != none) + if (MyGFxHUD != none) { ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX((bGlobal ? KillerPRI : None), None, ,false, Victim); } } - else if(KFExtendedHUD(myHUD)!=None && Victim!=None) + else if (KFExtendedHUD(myHUD)!=None && Victim!=None) KFExtendedHUD(myHUD).AddKillMessage(Victim,1,KillerPRI,byte(bGlobal)); } unreliable client function ReceiveDamageMessage(class Victim, int Damage) { - if(!bHideDamageMsg && KFExtendedHUD(myHUD)!=None && Victim!=None) + if (!bHideDamageMsg && KFExtendedHUD(myHUD)!=None && Victim!=None) KFExtendedHUD(myHUD).AddKillMessage(Victim,Damage,None,2); } unreliable client function ClientNumberMsg(int Count, vector Pos, EDmgMsgType Type) { - if(!bHideNumberMsg && KFExtendedHUD(myHUD)!=None) + if (!bHideNumberMsg && KFExtendedHUD(myHUD)!=None) KFExtendedHUD(myHUD).AddNumberMsg(Count,Pos,Type); } reliable client event TeamMessage(PlayerReplicationInfo PRI, coerce string S, name Type, optional float MsgLifeTime ) { - //if(((Type == 'Say') || (Type == 'TeamSay')) && (PRI != None)) + //if (((Type == 'Say') || (Type == 'TeamSay')) && (PRI != None)) // SpeakTTS(S, PRI); <- KF built without TTS... // since this is on the client, we can assume that if Player exists, it is a LocalPlayer - if(Player!=None) + if (Player!=None) { - if(((Type == 'Say') || (Type == 'TeamSay')) && (PRI != None)) + if (((Type == 'Say') || (Type == 'TeamSay')) && (PRI != None)) S = PRI.GetHumanReadableName()$": "$S; LocalPlayer(Player).ViewportClient.ViewportConsole.OutputText("("$Type$") "$S); } if (MyGFxManager != none && MyGFxManager.PartyWidget != none) { - if(!MyGFxManager.PartyWidget.ReceiveMessage(S)) //Fails if message is for updating perks in a steam lobby + if (!MyGFxManager.PartyWidget.ReceiveMessage(S)) //Fails if message is for updating perks in a steam lobby return; } - if(MyGFxHUD != none) + if (MyGFxHUD != none) { - switch(Type) + switch (Type) { case 'Log': break; // Console only message. @@ -338,7 +338,7 @@ reliable client event TeamMessage(PlayerReplicationInfo PRI, coerce string S, na break; case 'Say': case 'TeamSay': - if(ExtPlayerReplicationInfo(PRI)!=None && ExtPlayerReplicationInfo(PRI).ShowAdminName()) + if (ExtPlayerReplicationInfo(PRI)!=None && ExtPlayerReplicationInfo(PRI).ShowAdminName()) MyGFxHUD.HudChatBox.AddChatMessage("("$ExtPlayerReplicationInfo(PRI).GetAdminNameAbr()$")"$S, ExtPlayerReplicationInfo(PRI).GetAdminColor()); else MyGFxHUD.HudChatBox.AddChatMessage(S, "64FE2E"); break; @@ -366,14 +366,14 @@ final function PopScreenMsg(string S) // Get lower part. i = InStr(S,"|"); - if(i!=-1) + if (i!=-1) { L = Mid(S,i+1); S = Left(S,i); // Get time. i = InStr(L,"|"); - if(i!=-1) + if (i!=-1) { T = float(Mid(L,i+1)); L = Left(L,i); @@ -386,18 +386,18 @@ reliable client function ClientKillMessage(class DamType, PlayerRepl local string Msg,S; local bool bFF; - if(Player==None || Victim==None) + if (Player==None || Victim==None) return; - if(bUseKF2DeathMessages && MyGFxHUD!=None) + if (bUseKF2DeathMessages && MyGFxHUD!=None) { - if(Victim==KillerPRI || (KillerPRI==None && KillerPawn==None)) // Suicide + if (Victim==KillerPRI || (KillerPRI==None && KillerPawn==None)) // Suicide ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(None, Victim, ,true); else ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(KillerPRI, Victim, ,true, KillerPawn); } - if(Victim==KillerPRI || (KillerPRI==None && KillerPawn==None)) // Suicide + if (Victim==KillerPRI || (KillerPRI==None && KillerPawn==None)) // Suicide { - if(Victim.GetTeamNum()==0) + if (Victim.GetTeamNum()==0) { Msg = ParseSuicideMsg(Chr(6)$"O"$Victim.GetHumanReadableName(),DamType); class'KFMusicStingerHelper'.static.PlayPlayerDiedStinger(Self); @@ -406,7 +406,7 @@ reliable client function ClientKillMessage(class DamType, PlayerRepl } else { - if(KillerPRI!=None && Victim.Team!=None && Victim.Team==KillerPRI.Team) // Team-kill + if (KillerPRI!=None && Victim.Team!=None && Victim.Team==KillerPRI.Team) // Team-kill { bFF = true; S = KillerPRI.GetHumanReadableName(); @@ -415,14 +415,14 @@ reliable client function ClientKillMessage(class DamType, PlayerRepl else // Killed by monster. { bFF = false; - if(KillerPRI!=None) + if (KillerPRI!=None) { S = KillerPRI.GetHumanReadableName(); } else { S = class'KFExtendedHUD'.Static.GetNameOf(KillerPawn); - if(class(KillerPawn)!=None && class(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss) // Boss type. + if (class(KillerPawn)!=None && class(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss) // Boss type. S = "the "$S; else S = class'KFExtendedHUD'.Static.GetNameArticle(S)@S; } @@ -431,7 +431,7 @@ reliable client function ClientKillMessage(class DamType, PlayerRepl Msg = ParseKillMsg(Victim.GetHumanReadableName(),S,bFF,DamType); } S = Class'KFExtendedHUD'.Static.StripMsgColors(Msg); - if(!bUseKF2DeathMessages) + if (!bUseKF2DeathMessages) KFExtendedHUD(myHUD).AddDeathMessage(Msg,S); ClientMessage(S,'DeathMessage'); } @@ -439,35 +439,35 @@ reliable client function ClientZedKillMessage(class DamType, string { local string Msg,S; - if(Player==None) + if (Player==None) return; - if(bUseKF2DeathMessages && MyGFxHUD!=None) + if (bUseKF2DeathMessages && MyGFxHUD!=None) { - if(KillerPRI==None && KillerPawn==None) // Suicide + if (KillerPRI==None && KillerPawn==None) // Suicide ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(None, None, Victim, true); else ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(KillerPRI, None, Victim, true, KillerPawn); } - if(KillerPRI==None && KillerPawn==None) // Suicide + if (KillerPRI==None && KillerPawn==None) // Suicide { Msg = ParseSuicideMsg(Chr(6)$"O"$Victim,DamType); } else { - if(KillerPRI!=None) // Team-kill + if (KillerPRI!=None) // Team-kill { S = KillerPRI.GetHumanReadableName(); } else // Killed by monster. { S = class'KFExtendedHUD'.Static.GetNameOf(KillerPawn); - if(class(KillerPawn)!=None && class(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss) // Boss type. + if (class(KillerPawn)!=None && class(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss) // Boss type. S = "the "$S; else S = class'KFExtendedHUD'.Static.GetNameArticle(S)@S; } Msg = ParseKillMsg(Victim,S,bFFKill,DamType); } S = Class'KFExtendedHUD'.Static.StripMsgColors(Msg); - if(!bUseKF2DeathMessages) + if (!bUseKF2DeathMessages) KFExtendedHUD(myHUD).AddDeathMessage(Msg,S); ClientMessage(S,'DeathMessage'); } @@ -476,14 +476,14 @@ simulated final function string ParseSuicideMsg(string Victim, class local string S; S = string(DamType.Name); - if(Left(S,15)~="KFDT_Ballistic_") + if (Left(S,15)~="KFDT_Ballistic_") { S = Mid(S,15); // Weapon name. return Victim$Chr(6)$"M killed himself with "$S; } - else if(class(DamType)!=None) + else if (class(DamType)!=None) return Victim$Chr(6)$"M was burned to death"; - else if(class(DamType)!=None) + else if (class(DamType)!=None) return Victim$Chr(6)$"M was blown into pieces"; return Victim$Chr(6)$"M had a sudden heart attack"; } @@ -493,14 +493,14 @@ simulated final function string ParseKillMsg(string Victim, string Killer, bool T = (bFF ? "O" : "K"); S = string(DamType.Name); - if(Left(S,15)~="KFDT_Ballistic_") + if (Left(S,15)~="KFDT_Ballistic_") { S = Mid(S,15); // Weapon name. return Chr(6)$"O"$Victim$Chr(6)$"M was killed by "$Chr(6)$T$Killer$Chr(6)$"M's "$S; } - else if(class(DamType)!=None) + else if (class(DamType)!=None) return Chr(6)$"O"$Victim$Chr(6)$"M was incinerated by "$Chr(6)$T$Killer; - else if(class(DamType)!=None) + else if (class(DamType)!=None) return Chr(6)$"O"$Victim$Chr(6)$"M was blown up by "$Chr(6)$T$Killer; return Chr(6)$"O"$Victim$Chr(6)$"M was killed by "$Chr(6)$T$Killer; } @@ -523,18 +523,18 @@ simulated final function ToggleFPBody(bool bEnable) bShowFPLegs = bEnable; Class'ExtPlayerController'.Default.bShowFPLegs = bEnable; - if(ExtHumanPawn(Pawn)!=None) + if (ExtHumanPawn(Pawn)!=None) ExtHumanPawn(Pawn).UpdateFPLegs(); } /*exec function KickBan(string S) { - if(WorldInfo.Game!=None) + if (WorldInfo.Game!=None) WorldInfo.Game.KickBan(S); }*/ exec function Kick(string S) { - if(WorldInfo.Game!=None) + if (WorldInfo.Game!=None) WorldInfo.Game.Kick(S); } reliable server function SkipLobby(); @@ -543,7 +543,7 @@ Delegate OnChangePerk(ExtPlayerController PC, class NewPerk); reliable server function SwitchToPerk(class PerkClass) { - if(PerkClass!=None) + if (PerkClass!=None) OnChangePerk(Self,PerkClass); } @@ -551,7 +551,7 @@ Delegate OnBoughtStats(ExtPlayerController PC, class PerkClass, in reliable server function BuyPerkStat(class PerkClass, int iStat, int Amount) { - if(PerkClass!=None && Amount>0 && iStat>=0) + if (PerkClass!=None && Amount>0 && iStat>=0) OnBoughtStats(Self,PerkClass,iStat,Amount); } @@ -559,7 +559,7 @@ Delegate OnBoughtTrait(ExtPlayerController PC, class PerkClass, cl reliable server function BoughtTrait(class PerkClass, class Trait) { - if(PerkClass!=None && Trait!=None) + if (PerkClass!=None && Trait!=None) OnBoughtTrait(Self,PerkClass,Trait); } @@ -567,7 +567,7 @@ Delegate OnPerkReset(ExtPlayerController PC, class PerkClass, bool reliable server function ServerResetPerk(class PerkClass, bool bPrestige) { - if(PerkClass!=None) + if (PerkClass!=None) OnPerkReset(Self,PerkClass,bPrestige); } @@ -580,7 +580,7 @@ reliable server function AdminRPGHandle(int PlayerID, int Action) simulated reliable client event bool ShowConnectionProgressPopup(EProgressMessageType ProgressType, string ProgressTitle, string ProgressDescription, bool SuppressPasswordRetry = false) { - switch(ProgressType) + switch (ProgressType) { case PMT_ConnectionFailure : case PMT_PeerConnectionFailure : @@ -598,7 +598,7 @@ simulated reliable client event bool ShowConnectionProgressPopup(EProgressMessag simulated function CancelConnection() { - if(KFExtendedHUD(myHUD)!=None) + if (KFExtendedHUD(myHUD)!=None) KFExtendedHUD(myHUD).CancelConnection(); else class'Engine'.Static.GetEngine().GameViewport.ConsoleCommand("Disconnect"); } @@ -607,7 +607,7 @@ function NotifyLevelUp(class PerkClass, byte PerkLevel, byte NewPrestige function ShowBossNameplate(KFInterface_MonsterBoss KFBoss, optional string PlayerName) { - if(!bNamePlateShown) // Dont make multiple bosses pop this up multiple times. + if (!bNamePlateShown) // Dont make multiple bosses pop this up multiple times. { bNamePlateShown = true; Super.ShowBossNameplate(KFBoss,PlayerName); @@ -616,19 +616,19 @@ function ShowBossNameplate(KFInterface_MonsterBoss KFBoss, optional string Playe } function HideBossNameplate() { - if(!bNamePlateHidden) + if (!bNamePlateHidden) { bNamePlateHidden = false; Super.HideBossNameplate(); ClearTimer('HideBossNameplate'); - if(MyGFxHUD!=None) + if (MyGFxHUD!=None) MyGFxHUD.MusicNotification.SetVisible(true); } } function UpdateRotation(float DeltaTime) { - if(OldViewRot!=Rotation && Pawn!=None && Pawn.IsAliveAndWell()) + if (OldViewRot!=Rotation && Pawn!=None && Pawn.IsAliveAndWell()) NotifyFixed(1); Super.UpdateRotation(DeltaTime); OldViewRot = Rotation; @@ -649,7 +649,7 @@ function DefClientResponse(byte CallID, byte Code, int DataA, int DataB); reliable client function ClientUsedAmmo(Ext_T_SupplierInteract S) { - if(Pawn!=None && S!=None) + if (Pawn!=None && S!=None) S.UsedOnClient(Pawn); } @@ -657,14 +657,14 @@ unreliable server function ServerNextSpectateMode() { local Pawn HumanViewTarget; - if(!IsSpectating()) + if (!IsSpectating()) return; // switch to roaming if human viewtarget is dead - if(CurrentSpectateMode != SMODE_Roaming) + if (CurrentSpectateMode != SMODE_Roaming) { HumanViewTarget = Pawn(ViewTarget); - if(HumanViewTarget == none || !HumanViewTarget.IsAliveAndWell()) + if (HumanViewTarget == none || !HumanViewTarget.IsAliveAndWell()) { SpectateRoaming(); return; @@ -706,7 +706,7 @@ reliable server function ServerViewPlayerID(int ID) { local PlayerReplicationInfo PRI; - if(!IsSpectating()) + if (!IsSpectating()) return; // Find matching player by ID @@ -715,12 +715,12 @@ reliable server function ServerViewPlayerID(int ID) if (PRI.PlayerID==ID) break; } - if(PRI==None || PRI.PlayerID!=ID || Controller(PRI.Owner)==None || Controller(PRI.Owner).Pawn==None || !WorldInfo.Game.CanSpectate(self, PRI)) + if (PRI==None || PRI.PlayerID!=ID || Controller(PRI.Owner)==None || Controller(PRI.Owner).Pawn==None || !WorldInfo.Game.CanSpectate(self, PRI)) return; SetViewTarget(PRI); ClientMessage("Now viewing from "$PRI.GetHumanReadableName()); - if(CurrentSpectateMode==SMODE_Roaming) + if (CurrentSpectateMode==SMODE_Roaming) SpectatePlayer(SMODE_PawnFreeCam); } @@ -731,7 +731,7 @@ reliable server function SpectateRoaming() P = Pawn(ViewTarget); ClientMessage("Viewing from own camera."); Super.SpectateRoaming(); - if(P!=None) + if (P!=None) { SetLocation(P.Location); SetRotation(P.GetViewRotation()); @@ -746,7 +746,7 @@ reliable client function ClientSetLocation(vector NewLocation, rotator NewRotati unreliable server function ServerPlayLevelUpDialog() { - if(NextCommTime=20.f) // Finished view. + if (T>=20.f) // Finished view. { bEndGameCamFocus = false; - if(LocalPlayer(Player)!=None && KFPawn(ViewTarget)!=None) + if (LocalPlayer(Player)!=None && KFPawn(ViewTarget)!=None) KFPawn(ViewTarget).SetMeshVisibility(!Global.UsingFirstPersonCamera()); return false; } @@ -905,17 +905,17 @@ final function bool CalcEndGameCam() CalcViewLocation.Z = 1.f; RT = WorldInfo.RealTimeSeconds; - if(T<4.f) + if (T<4.f) RT += (4.f-T); CalcViewLocation.X = Sin(RT*0.08f); CalcViewLocation.Y = Cos(RT*0.08f); CalcViewLocation = EndGameCamFocusPos[0] + Normal(CalcViewLocation)*350.f; - if(Trace(HL,HN,CalcViewLocation,EndGameCamFocusPos[0],false,vect(16,16,16))!=None) + if (Trace(HL,HN,CalcViewLocation,EndGameCamFocusPos[0],false,vect(16,16,16))!=None) CalcViewLocation = HL; CalcViewRotation = rotator(EndGameCamFocusPos[0]-CalcViewLocation); - if(T<4.f && LocalPlayer(Player)!=None) // Zoom in to epic death. + if (T<4.f && LocalPlayer(Player)!=None) // Zoom in to epic death. { T*=0.25; CalcViewLocation = CalcViewLocation*T + EndGameCamFocusPos[1]*(1.f-T); @@ -925,7 +925,7 @@ final function bool CalcEndGameCam() } simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation) { - if(bEndGameCamFocus && CalcEndGameCam()) + if (bEndGameCamFocus && CalcEndGameCam()) { out_Location = CalcViewLocation; out_Rotation = CalcViewRotation; @@ -935,7 +935,7 @@ simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rota } exec function DebugRenderMode() { - if(WorldInfo.NetMode!=NM_Client) + if (WorldInfo.NetMode!=NM_Client) { bRenderModes = !bRenderModes; SaveConfig(); @@ -946,7 +946,7 @@ exec function DebugRenderMode() // Stats traffic. reliable server function ServerRequestStats(byte ListNum) { - if(ListNum<3) + if (ListNum<3) { TransitListNum = ListNum; TransitIndex = 0; @@ -955,7 +955,7 @@ reliable server function ServerRequestStats(byte ListNum) } function SendNextList() { - if(!OnClientGetStat(Self,TransitListNum,TransitIndex++)) + if (!OnClientGetStat(Self,TransitListNum,TransitIndex++)) { ClientGetStat(TransitListNum,true); ClearTimer('SendNextList'); @@ -987,21 +987,21 @@ Ignores NotifyPhysicsVolumeChange,ServerCamera,ResetCameraMode; { FOVAngle = DesiredFOV; - if(WorldInfo.NetMode!=NM_Client) + if (WorldInfo.NetMode!=NM_Client) SetCameraMode('ThirdPerson'); } event EndState(Name NewState) { FOVAngle = DesiredFOV; - if(Pawn!=none && NewState!='Dead') + if (Pawn!=none && NewState!='Dead') Global.SetCameraMode('FirstPerson'); } function PlayerMove(float DeltaTime) { local rotator OldRotation; - if(Pawn == None) + if (Pawn == None) GotoState('Dead'); else { @@ -1011,7 +1011,7 @@ Ignores NotifyPhysicsVolumeChange,ServerCamera,ResetCameraMode; bDoubleJump = false; bPressedJump = false; - if(Role < ROLE_Authority) // then save this move and replicate it + if (Role < ROLE_Authority) // then save this move and replicate it ReplicateMove(DeltaTime, vect(0,0,0), DCLICK_None, OldRotation - Rotation); else ProcessMove(DeltaTime, vect(0,0,0), DCLICK_None, OldRotation - Rotation); } @@ -1021,24 +1021,24 @@ Ignores NotifyPhysicsVolumeChange,ServerCamera,ResetCameraMode; local Actor TheViewTarget; local vector HL,HN,EndOffset; - if(bEndGameCamFocus && CalcEndGameCam()) + if (bEndGameCamFocus && CalcEndGameCam()) { out_Location = CalcViewLocation; out_Rotation = CalcViewRotation; return; } - if(Global.UsingFirstPersonCamera()) + if (Global.UsingFirstPersonCamera()) Global.GetPlayerViewPoint(out_Location,out_Rotation); else { out_Rotation = Rotation; TheViewTarget = GetViewTarget(); - if(TheViewTarget==None) + if (TheViewTarget==None) TheViewTarget = Self; out_Location = TheViewTarget.Location; EndOffset = out_Location-vector(Rotation)*250.f; - if(TheViewTarget.Trace(HL,HN,EndOffset,out_Location,false,vect(16,16,16))!=None) + if (TheViewTarget.Trace(HL,HN,EndOffset,out_Location,false,vect(16,16,16))!=None) out_Location = HL; else out_Location = EndOffset; } @@ -1056,14 +1056,14 @@ ignores SeePlayer, HearNoise, Bump; local rotator OldRotation; local bool bSaveJump; - if(Pawn == None) + if (Pawn == None) { GotoState('Dead'); } else { GetAxes(Pawn.Rotation,X,Y,Z); - if(VSZombie(Pawn)!=None) + if (VSZombie(Pawn)!=None) VSZombie(Pawn).ModifyPlayerInput(Self,DeltaTime); // Update acceleration. @@ -1083,7 +1083,7 @@ ignores SeePlayer, HearNoise, Bump; UpdateRotation(DeltaTime); bDoubleJump = false; - if(bPressedJump && Pawn.CannotJumpNow()) + if (bPressedJump && Pawn.CannotJumpNow()) { bSaveJump = true; bPressedJump = false; @@ -1093,7 +1093,7 @@ ignores SeePlayer, HearNoise, Bump; bSaveJump = false; } - if(Role < ROLE_Authority) // then save this move and replicate it + if (Role < ROLE_Authority) // then save this move and replicate it { ReplicateMove(DeltaTime, NewAccel, DoubleClickMove, OldRotation - Rotation); } @@ -1122,7 +1122,7 @@ state Dead FindGoodView(); CleanOutSavedMoves(); - if(KFPawn(ViewTarget)!=none) + if (KFPawn(ViewTarget)!=none) { KFPawn(ViewTarget).SetMeshVisibility(true); } @@ -1130,17 +1130,17 @@ state Dead // Deactivate any post process effects when we die ResetGameplayPostProcessFX(); - if(CurrentPerk != none) + if (CurrentPerk != none) CurrentPerk.PlayerDied(); KFPI = KFPlayerInput(PlayerInput); - if(KFPI != none) + if (KFPI != none) KFPI.HideVoiceComms(); - if(MyGFxManager != none) + if (MyGFxManager != none) MyGFxManager.CloseMenus(); - if(MyGFxHUD != none) + if (MyGFxHUD != none) MyGFxHUD.ClearBuffIcons(); } simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation) @@ -1148,7 +1148,7 @@ state Dead local Actor TheViewTarget; local vector HL,HN,EndOffset; - if(bEndGameCamFocus && CalcEndGameCam()) + if (bEndGameCamFocus && CalcEndGameCam()) { out_Location = CalcViewLocation; out_Rotation = CalcViewRotation; @@ -1156,12 +1156,12 @@ state Dead } out_Rotation = Rotation; TheViewTarget = GetViewTarget(); - if(TheViewTarget==None) + if (TheViewTarget==None) TheViewTarget = Self; out_Location = TheViewTarget.Location; EndOffset = out_Location-vector(Rotation)*400.f; - if(TheViewTarget.Trace(HL,HN,EndOffset,out_Location,false,vect(16,16,16))!=None) + if (TheViewTarget.Trace(HL,HN,EndOffset,out_Location,false,vect(16,16,16))!=None) out_Location = HL; else out_Location = EndOffset; } diff --git a/ServerExt/Classes/ExtPlayerInput.uc b/ServerExt/Classes/ExtPlayerInput.uc index 9b95fc8..36e5a7f 100644 --- a/ServerExt/Classes/ExtPlayerInput.uc +++ b/ServerExt/Classes/ExtPlayerInput.uc @@ -16,9 +16,9 @@ simulated exec function IronSights(optional bool bHoldButtonMode) { local KFWeapon KFW; - if(Pawn != none) + if (Pawn != none) { - if(KFPawn_Monster(Pawn)!=None) + if (KFPawn_Monster(Pawn)!=None) Pawn.StartFire(1); else { @@ -32,9 +32,9 @@ simulated exec function IronSightsRelease(optional bool bHoldButtonMode) { local KFWeapon KFW; - if(Pawn != none) + if (Pawn != none) { - if(KFPawn_Monster(Pawn)!=None) + if (KFPawn_Monster(Pawn)!=None) Pawn.StopFire(1); else { @@ -47,7 +47,7 @@ simulated exec function IronSightsRelease(optional bool bHoldButtonMode) simulated exec function ToggleFlashlight() { - if(KFPawn_Monster(Pawn)!=None && Pawn.Health>0) + if (KFPawn_Monster(Pawn)!=None && Pawn.Health>0) SetNightVision(!bNightVisionActive); else Super.ToggleFlashlight(); } @@ -55,10 +55,10 @@ simulated exec function ToggleFlashlight() function PreClientTravel(string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel) { Super.PreClientTravel(PendingURL,TravelType,bIsSeamlessTravel); - if(!bHandledTravel) + if (!bHandledTravel) { bHandledTravel = true; - if(KFExtendedHUD(MyHUD)!=None) + if (KFExtendedHUD(MyHUD)!=None) KFExtendedHUD(MyHUD).NotifyLevelChange(true); } } @@ -67,20 +67,20 @@ event bool FilterButtonInput(int ControllerId, Name Key, EInputEvent Event, floa { if (MyGfxManager.bAfterLobby && Event==IE_Pressed && (Key == 'Escape' || Key == 'XboxTypeS_Start')) { - if(MyGUIController==None || MyGUIController.bIsInvalid) + if (MyGUIController==None || MyGUIController.bIsInvalid) { MyGUIController = class'KF2GUIController'.Static.GetGUIController(Outer); - if(MyGUIController==None) + if (MyGUIController==None) { ExtPlayerController(Outer).CancelConnection(); return false; } } - if(MyGUIController.bIsInMenuState) + if (MyGUIController.bIsInMenuState) { return false; } - else if(MyGFxManager.bMenusOpen) + else if (MyGFxManager.bMenusOpen) { return MyGFxManager.ToggleMenus(); } diff --git a/ServerExt/Classes/ExtPlayerReplicationInfo.uc b/ServerExt/Classes/ExtPlayerReplicationInfo.uc index 13ef9d6..d19d3cf 100644 --- a/ServerExt/Classes/ExtPlayerReplicationInfo.uc +++ b/ServerExt/Classes/ExtPlayerReplicationInfo.uc @@ -81,11 +81,11 @@ simulated function PostBeginPlay() Super.PostBeginPlay(); SetTimer(1,true,'TickPT'); - if(WorldInfo.NetMode!=NM_DedicatedServer) + if (WorldInfo.NetMode!=NM_DedicatedServer) { HUDPerkColor = PickPerkColor(); PC = GetALocalPlayerController(); - if(PC!=None) + if (PC!=None) LocalOwnerPRI = ExtPlayerReplicationInfo(PC.PlayerReplicationInfo); } else LocalOwnerPRI = Self; // Dedicated server can use self PRI. @@ -108,7 +108,7 @@ simulated function ClientInitialize(Controller C) Super.ClientInitialize(C); - if(WorldInfo.NetMode!=NM_DedicatedServer) + if (WorldInfo.NetMode!=NM_DedicatedServer) { LocalOwnerPRI = Self; @@ -125,7 +125,7 @@ simulated function TickPT() simulated event ReplicatedEvent(name VarName) { - switch(VarName) + switch (VarName) { case 'RepLevelProgress': HUDPerkColor = PickPerkColor(); @@ -163,7 +163,7 @@ function OverrideWith(PlayerReplicationInfo PRI) } simulated final function UpdateNameTag() { - if(NameTag!="") + if (NameTag!="") TaggedPlayerName = "["$NameTag$"] "$PlayerName; else TaggedPlayerName = PlayerName; } @@ -177,7 +177,7 @@ final function SetLevelProgress(int CurLevel, int CurPrest, int MinLevel, int Ma RepLevelProgress = V; bForceNetUpdate = true; - if(WorldInfo.NetMode!=NM_DedicatedServer) + if (WorldInfo.NetMode!=NM_DedicatedServer) HUDPerkColor = PickPerkColor(); } simulated final function string GetPerkLevelStr() @@ -189,20 +189,20 @@ simulated final function color PickPerkColor() local float P; local byte i; - if(RepLevelProgress==0) + if (RepLevelProgress==0) return MakeColor(255,255,255,255); P = float(RepLevelProgress) / 255.f; - if(P<0.25f) // White - Blue + if (P<0.25f) // White - Blue { i = 255 - (P*1020.f); return MakeColor(i,i,255,255); } - if(P<0.5f) // Blue - Green + if (P<0.5f) // Blue - Green { i = ((P-0.25f)*1020.f); return MakeColor(0,i,255-i,255); } - if(P<0.75f) // Green - Red + if (P<0.75f) // Green - Red { i = ((P-0.5f)*1020.f); return MakeColor(i,255-i,0,255); @@ -231,10 +231,10 @@ Delegate bool OnRepNextItem(ExtPlayerReplicationInfo PRI, int RepIndex) simulated reliable client function ClientAddTraderItem(int Index, FCustomTraderItem Item) { // Make sure to not execute on server. - if(WorldInfo.NetMode!=NM_Client && (PlayerController(Owner)==None || LocalPlayer(PlayerController(Owner).Player)==None)) + if (WorldInfo.NetMode!=NM_Client && (PlayerController(Owner)==None || LocalPlayer(PlayerController(Owner).Player)==None)) return; - if(CustomList==None) + if (CustomList==None) { CustomList = CreateNewList(); RecheckGRI(); @@ -259,12 +259,12 @@ simulated static final function SetWeaponInfo(bool bDedicated, int Index, FCusto local array S; local int i; - if(List.SaleItems.Length<=Index) + if (List.SaleItems.Length<=Index) List.SaleItems.Length = Index+1; List.SaleItems[Index].WeaponDef = Item.WeaponDef; List.SaleItems[Index].ClassName = Item.WeaponClass.Name; - if(class(Item.WeaponClass)!=None && class(Item.WeaponClass).Default.SingleClass!=None) + if (class(Item.WeaponClass)!=None && class(Item.WeaponClass).Default.SingleClass!=None) List.SaleItems[Index].SingleClassName = class(Item.WeaponClass).Default.SingleClass.Name; else List.SaleItems[Index].SingleClassName = ''; List.SaleItems[Index].DualClassName = Item.WeaponClass.Default.DualClass!=None ? Item.WeaponClass.Default.DualClass.Name : ''; @@ -278,13 +278,13 @@ simulated static final function SetWeaponInfo(bool bDedicated, int Index, FCusto List.SaleItems[Index].InitialSecondaryAmmo = Item.WeaponClass.Default.InitialSpareMags[1]; List.SaleItems[Index].WeaponUpgradeDmgMultiplier[0] = 1.0; - for(i = 0;i=(CharacterArchetypes.Length+CustomCharList.Length)) + if (CharIndex>=(CharacterArchetypes.Length+CustomCharList.Length)) return false; - if(SaveDataObjects.Length<=CharIndex) + if (SaveDataObjects.Length<=CharIndex) SaveDataObjects.Length = CharIndex+1; - if(SaveDataObjects[CharIndex]==None) + if (SaveDataObjects[CharIndex]==None) { C = (CharIndex=(CharacterArchetypes.Length+CustomCharList.Length)) + if (CustomCharacter.CharacterIndex>=(CharacterArchetypes.Length+CustomCharList.Length)) return false; - if(SaveDataObjects.Length<=CustomCharacter.CharacterIndex) + if (SaveDataObjects.Length<=CustomCharacter.CharacterIndex) SaveDataObjects.Length = CustomCharacter.CharacterIndex+1; - if(SaveDataObjects[CustomCharacter.CharacterIndex]==None) + if (SaveDataObjects[CustomCharacter.CharacterIndex]==None) { C = (CustomCharacter.CharacterIndex=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(CharIndex)) + if (CharIndex>=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(CharIndex)) CharIndex = 0; - if(bFirstSet && RepCustomizationInfo.CharacterIndex==CharIndex) + if (bFirstSet && RepCustomizationInfo.CharacterIndex==CharIndex) { // Copy properties from default character info. NewChar.HeadMeshIndex = RepCustomizationInfo.HeadMeshIndex; NewChar.HeadSkinIndex = RepCustomizationInfo.HeadSkinIndex; NewChar.BodyMeshIndex = RepCustomizationInfo.BodyMeshIndex; NewChar.BodySkinIndex = RepCustomizationInfo.BodySkinIndex; - for(i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i) + for (i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i) { NewChar.AttachmentMeshIndices[i] = RepCustomizationInfo.AttachmentMeshIndices[i]; NewChar.AttachmentSkinIndices[i] = RepCustomizationInfo.AttachmentSkinIndices[i]; } } - if(LoadPlayerCharacter(CharIndex,NewChar)) + if (LoadPlayerCharacter(CharIndex,NewChar)) { NewChar.CharacterIndex = CharIndex; CustomCharacter = NewChar; ServerSetCharacterX(NewChar); - if(WorldInfo.NetMode==NM_Client) + if (WorldInfo.NetMode==NM_Client) CharacterCustomizationChanged(); } } simulated function UpdateCustomization(byte Type, byte MeshIndex, byte SkinIndex, optional byte SlotIndex) { - switch(Type) + switch (Type) { case CO_Head: CustomCharacter.HeadMeshIndex = MeshIndex; @@ -503,26 +503,26 @@ simulated function UpdateCustomization(byte Type, byte MeshIndex, byte SkinIndex } SavePlayerCharacter(); ServerSetCharacterX(CustomCharacter); - if(WorldInfo.NetMode==NM_Client) + if (WorldInfo.NetMode==NM_Client) CharacterCustomizationChanged(); } simulated final function RemoveAttachments() { local byte i; - for(i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i) + for (i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i) { CustomCharacter.AttachmentMeshIndices[i] = `CLEARED_ATTACHMENT_INDEX; CustomCharacter.AttachmentSkinIndices[i] = 0; } SavePlayerCharacter(); ServerSetCharacterX(CustomCharacter); - if(WorldInfo.NetMode==NM_Client) + if (WorldInfo.NetMode==NM_Client) CharacterCustomizationChanged(); } simulated function ClearCharacterAttachment(int AttachmentIndex) { - if(UsesCustomChar()) + if (UsesCustomChar()) { CustomCharacter.AttachmentMeshIndices[AttachmentIndex] = `CLEARED_ATTACHMENT_INDEX; CustomCharacter.AttachmentSkinIndices[AttachmentIndex] = 0; @@ -532,7 +532,7 @@ simulated function ClearCharacterAttachment(int AttachmentIndex) reliable server final function ServerSetCharacterX(FMyCustomChar NewMeshInfo) { - if(NewMeshInfo.CharacterIndex>=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(NewMeshInfo.CharacterIndex)) + if (NewMeshInfo.CharacterIndex>=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(NewMeshInfo.CharacterIndex)) return; CustomCharacter = NewMeshInfo; @@ -544,7 +544,7 @@ reliable server final function ServerSetCharacterX(FMyCustomChar NewMeshInfo) } simulated final function bool IsClientCharLocked(byte Index) { - if(Index=CharacterArchetypes.Length); } simulated final function KFCharacterInfo_Human GetSelectedArch() { - if(UsesCustomChar()) + if (UsesCustomChar()) return (CustomCharacter.CharacterIndex=2) + if (Data.GetArVer()>=2) S = Data.ReadStr(); - if(S=="") // Stock skin. + if (S=="") // Stock skin. return; - for(i=0; i=2) + if (Data.GetArVer()>=2) S = Data.ReadStr(); - if(S=="") // Stock skin. + if (S=="") // Stock skin. return; Data.SkipBytes(4); n = Data.ReadInt(); - for(i=0; iBestScore) + if (BestN==None || Score>BestScore) { BestN = N; BestScore = Score; @@ -49,21 +49,21 @@ final function Actor PickBestSpawn() // See if can spawn ontop of other players. foreach WorldInfo.AllPawns(class'KFPawn_Human',H) { - if(!H.IsAliveAndWell() || H.Physics==PHYS_Falling || (ExtHumanPawn(H)!=None && ExtHumanPawn(H).bFeigningDeath)) + if (!H.IsAliveAndWell() || H.Physics==PHYS_Falling || (ExtHumanPawn(H)!=None && ExtHumanPawn(H).bFeigningDeath)) continue; Score = FRand(); foreach WorldInfo.AllPawns(class'KFPawn',P,H.Location,2000.f) { - if(!P.IsAliveAndWell()) + if (!P.IsAliveAndWell()) continue; Dist = VSize(H.Location-P.Location); - if(FastTrace(P.Location,H.Location)) + if (FastTrace(P.Location,H.Location)) Dist*=0.75; - if(P.IsA('KFPawn_Human')) + if (P.IsA('KFPawn_Human')) Score+=(3000.f-Dist)/3000.f; else Score-=(3500.f-Dist)/3500.f; } - if(BestN==None || Score>BestScore) + if (BestN==None || Score>BestScore) { BestN = H; BestScore = Score; @@ -83,14 +83,14 @@ function InitChecker() foreach WorldInfo.AllNavigationPoints(class'PlayerStart',PS) { Fallback = PS; - if(PS.bEnabled && PS.TeamIndex==0) + if (PS.bEnabled && PS.TeamIndex==0) { CheckSpawn(PS); - if(PendingList.Length!=0) + if (PendingList.Length!=0) break; } } - if(PendingList.Length==0 && Fallback!=None) + if (PendingList.Length==0 && Fallback!=None) CheckSpawn(Fallback); SetTimer(0.001,true,'NextCheck'); } @@ -99,9 +99,9 @@ function NextCheck() local NavigationPoint N; local byte i; - if(PendingList.Length!=0) + if (PendingList.Length!=0) { - while(++i<5 && PendingList.Length!=0) + while (++i<5 && PendingList.Length!=0) { N = PendingList[PendingList.Length-1]; PendingList.Remove(PendingList.Length-1,1); @@ -122,7 +122,7 @@ final function CheckSpawn(NavigationPoint N) local KFPawnBlockingVolume P; V = N.Location; - if(N.MaxPathSize.Radius>30 && N.MaxPathSize.Height>80 && FindSpot(vect(36,36,86),V) && KFDoorMarker(N)==None && PickupFactory(N)==None) + if (N.MaxPathSize.Radius>30 && N.MaxPathSize.Height>80 && FindSpot(vect(36,36,86),V) && KFDoorMarker(N)==None && PickupFactory(N)==None) { //DrawDebugLine(V,V+vect(0,0,50),255,255,255,true); ValidSpawnSpots.AddItem(N); @@ -132,22 +132,22 @@ final function CheckSpawn(NavigationPoint N) foreach N.PathList(R) { E = R.GetEnd(); - if(E==None || R.CollisionRadius<30 || R.CollisionHeight<80 || R.Class==Class'ProscribedReachSpec') + if (E==None || R.CollisionRadius<30 || R.CollisionHeight<80 || R.Class==Class'ProscribedReachSpec') { - //if(E!=None) + //if (E!=None) // DrawDebugLine(E.Location,N.Location,255,255,0,true); continue; } - if(CheckedList.Find(E)!=INDEX_NONE) + if (CheckedList.Find(E)!=INDEX_NONE) continue; // DO NOT go through any blocking volumes. V = (N.Location+E.Location) * 0.5; foreach OverlappingActors(class'KFPawnBlockingVolume',P,VSize(N.Location-V),V) { - if(P.bBlockPlayers && TraceComponent(V,V,P.CollisionComponent,E.Location,N.Location,vect(36,36,50))) + if (P.bBlockPlayers && TraceComponent(V,V,P.CollisionComponent,E.Location,N.Location,vect(36,36,50))) break; } - if(P==None) + if (P==None) { //DrawDebugLine(E.Location,N.Location,0,255,0,true); PendingList.AddItem(E); diff --git a/ServerExt/Classes/ExtTraderContainer_Filter.uc b/ServerExt/Classes/ExtTraderContainer_Filter.uc index a39700d..7d1a425 100644 --- a/ServerExt/Classes/ExtTraderContainer_Filter.uc +++ b/ServerExt/Classes/ExtTraderContainer_Filter.uc @@ -22,7 +22,7 @@ function SetPerkFilterData(byte FilterIndex) SetInt("selectedIndex", i); // Set the title of this filter based on either the perk or the off perk string - if(FilterIndex < PrM.UserPerks.Length) + if (FilterIndex < PrM.UserPerks.Length) { SetString("filterText", PrM.UserPerks[FilterIndex].PerkName); } diff --git a/ServerExt/Classes/ExtTraderContainer_PlayerInfo.uc b/ServerExt/Classes/ExtTraderContainer_PlayerInfo.uc index a3e94f5..a65fa6c 100644 --- a/ServerExt/Classes/ExtTraderContainer_PlayerInfo.uc +++ b/ServerExt/Classes/ExtTraderContainer_PlayerInfo.uc @@ -7,7 +7,7 @@ function SetPerkInfo() local float V; KFPC = ExtPlayerController(GetPC()); - if(KFPC!=none && KFPC.ActivePerkManager!=None && KFPC.ActivePerkManager.CurrentPerk!=None) + if (KFPC!=none && KFPC.ActivePerkManager!=None && KFPC.ActivePerkManager.CurrentPerk!=None) { CurrentPerk = KFPC.ActivePerkManager.CurrentPerk; SetString("perkName", CurrentPerk.PerkName); @@ -28,7 +28,7 @@ function SetPerkList() local Ext_PerkBase P; KFPC = ExtPlayerController(GetPC()); - if(KFPC != none && KFPC.ActivePerkManager!=None) + if (KFPC != none && KFPC.ActivePerkManager!=None) { DataProvider = CreateArray(); diff --git a/ServerExt/Classes/ExtTraderContainer_Store.uc b/ServerExt/Classes/ExtTraderContainer_Store.uc index 504f6d5..af3ff4e 100644 --- a/ServerExt/Classes/ExtTraderContainer_Store.uc +++ b/ServerExt/Classes/ExtTraderContainer_Store.uc @@ -11,7 +11,7 @@ function RefreshWeaponListByPerk(byte FilterIndex, const out array EKFPC = ExtPlayerController(KFPC); if (EKFPC!=none && EKFPC.ActivePerkManager!=None) { - if(FilterIndex } else { - if(ItemList[i].AssociatedPerkClasses.length > 0) + if (ItemList[i].AssociatedPerkClasses.length > 0) { switch (ItemList[i].AssociatedPerkClasses.Find(TargetPerkClass)) { diff --git a/ServerExt/Classes/ExtWeap_Pistol_9mm.uc b/ServerExt/Classes/ExtWeap_Pistol_9mm.uc index cfe1182..302be76 100644 --- a/ServerExt/Classes/ExtWeap_Pistol_9mm.uc +++ b/ServerExt/Classes/ExtWeap_Pistol_9mm.uc @@ -24,7 +24,7 @@ simulated function ConsumeAmmo(byte FireModeNum) simulated static event class GetWeaponPerkClass(class InstigatorPerkClass) { - if(InstigatorPerkClass != None) + if (InstigatorPerkClass != None) return InstigatorPerkClass; return default.AssociatedPerkClasses[0]; @@ -32,7 +32,7 @@ simulated static event class GetWeaponPerkClass(class Instigator simulated function KFPerk GetPerk() { - if(KFPlayer != None) + if (KFPlayer != None) return KFPlayer.GetPerk(); return super.GetPerk(); } \ No newline at end of file diff --git a/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc b/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc index 1243269..4a1abd6 100644 --- a/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc +++ b/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc @@ -24,7 +24,7 @@ simulated function ConsumeAmmo(byte FireModeNum) simulated static event class GetWeaponPerkClass(class InstigatorPerkClass) { - if(InstigatorPerkClass != None) + if (InstigatorPerkClass != None) return InstigatorPerkClass; return default.AssociatedPerkClasses[0]; diff --git a/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc b/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc index c51ed2e..9f3347d 100644 --- a/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc +++ b/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc @@ -26,13 +26,13 @@ simulated static function bool AllowedForAllPerks() simulated function ConsumeAmmo(byte FireModeNum) { - if(FireModeNum == ALTFIRE_FIREMODE) + if (FireModeNum == ALTFIRE_FIREMODE) super.ConsumeAmmo(FireModeNum); } simulated static event class GetWeaponPerkClass(class InstigatorPerkClass) { - if(InstigatorPerkClass != None) + if (InstigatorPerkClass != None) return InstigatorPerkClass; return default.AssociatedPerkClasses[0]; @@ -40,7 +40,7 @@ simulated static event class GetWeaponPerkClass(class Instigator simulated function KFPerk GetPerk() { - if(KFPlayer != None) + if (KFPlayer != None) return KFPlayer.GetPerk(); return super.GetPerk(); } \ No newline at end of file diff --git a/ServerExt/Classes/ExtWeaponSkinList.uc b/ServerExt/Classes/ExtWeaponSkinList.uc index 89da31b..f7dae85 100644 --- a/ServerExt/Classes/ExtWeaponSkinList.uc +++ b/ServerExt/Classes/ExtWeaponSkinList.uc @@ -27,28 +27,28 @@ static function array GetWeaponSkin(int ItemId, EWeaponSkinTy local string FirstPMat; i = default.Skins.Find('Id', ItemId); - if(i > -1) + if (i > -1) { - switch(Type) + switch (Type) { case WST_FirstPerson: foreach default.Skins[i].MIC_1P(FirstPMat) { LoadedMat = MaterialInterface(DynamicLoadObject(FirstPMat, class'MaterialInterface')); - if(LoadedMat != None) + if (LoadedMat != None) Mats.AddItem(LoadedMat); } break; case WST_ThirdPerson: LoadedMat = MaterialInterface(DynamicLoadObject(default.Skins[i].MIC_3P, class'MaterialInterface')); - if(LoadedMat != None) + if (LoadedMat != None) Mats.AddItem(LoadedMat); break; case WST_Pickup: LoadedMat = MaterialInterface(DynamicLoadObject(default.Skins[i].MIC_Pickup, class'MaterialInterface')); - if(LoadedMat != None) + if (LoadedMat != None) Mats.AddItem(LoadedMat); break; @@ -63,7 +63,7 @@ static function SaveWeaponSkin(class WeaponDef, int ID, ExtP local int ALen, i; i = PC.SavedWeaponSkins.Find('WepDef', WeaponDef); - if(i > -1) + if (i > -1) PC.SavedWeaponSkins.Remove(i, 1); ALen = PC.SavedWeaponSkins.Length; @@ -77,7 +77,7 @@ static function bool IsSkinEquip(class WeaponDef, int ID, Ex { local int i; i = PC.SavedWeaponSkins.Find('ID', ID); - if(i > -1) + if (i > -1) return true; return false; diff --git a/ServerExt/Classes/ExtWebAdmin_UI.uc b/ServerExt/Classes/ExtWebAdmin_UI.uc index fc967fb..3c9278a 100644 --- a/ServerExt/Classes/ExtWebAdmin_UI.uc +++ b/ServerExt/Classes/ExtWebAdmin_UI.uc @@ -45,7 +45,7 @@ final function AddSettingsPage(string PageName, class Obj, const out arr local int i; i = ConfigList.Find('PageName',PageName); - if(i>=0) // Make sure no dupe pages. + if (i>=0) // Make sure no dupe pages. PageName $= "_"$(ConfigList[i].Dupes++); i = ConfigList.Length; @@ -56,7 +56,7 @@ final function AddSettingsPage(string PageName, class Obj, const out arr ConfigList[i].GetValue = GetFunc; ConfigList[i].SetValue = SetFunc; } -final function bool HasConfigFor(class Obj) +final function bool HasConfigfor (class Obj) { return (ConfigList.Find('ObjClass',Obj)>=0); } diff --git a/ServerExt/Classes/ExtWidget_BossHealthBar.uc b/ServerExt/Classes/ExtWidget_BossHealthBar.uc index 98c4800..f7c20f6 100644 --- a/ServerExt/Classes/ExtWidget_BossHealthBar.uc +++ b/ServerExt/Classes/ExtWidget_BossHealthBar.uc @@ -7,12 +7,12 @@ var transient bool bVisib,bHasInit; function TickHud(float DeltaTime) { - if(!KFPC.bHideBossHealthBar && BossList.Length>0) + if (!KFPC.bHideBossHealthBar && BossList.Length>0) { - if(KFPC.WorldInfo.RealTimeSeconds>LastUpdateTime && HasBossesAlive()) + if (KFPC.WorldInfo.RealTimeSeconds>LastUpdateTime && HasBossesAlive()) { LastUpdateTime = KFPC.WorldInfo.RealTimeSeconds + UpdateTickTime; - if(!bVisib) + if (!bVisib) { LastHP = -1; LastShield = -1; @@ -22,12 +22,12 @@ function TickHud(float DeltaTime) UpdateBossInfo(); } } - else if(bHasInit) + else if (bHasInit) { NumBosses = 0; bHasInit = false; BossList.Length = 0; - if(bVisib) + if (bVisib) { bVisib = false; SetVisible(false); @@ -39,14 +39,14 @@ final function bool HasBossesAlive() { local int i; - for(i=(BossList.Length-1); i>=0; --i) + for (i=(BossList.Length-1); i>=0; --i) { - if(BossList[i]==None || BossList[i].bDeleteMe || BossList[i].GetTeamNum()==0) + if (BossList[i]==None || BossList[i].bDeleteMe || BossList[i].GetTeamNum()==0) { BossList.Remove(i,1); --NumBosses; } - else if(!BossList[i].IsAliveAndWell()) + else if (!BossList[i].IsAliveAndWell()) BossList.Remove(i,1); } return (BossList.Length>0); @@ -54,7 +54,7 @@ final function bool HasBossesAlive() function SetBossPawn(KFInterface_MonsterBoss NewBoss) { - if(!KFPC.bHideBossHealthBar && NewBoss!=None && NewBoss.GetMonsterPawn().IsAliveAndWell()) + if (!KFPC.bHideBossHealthBar && NewBoss!=None && NewBoss.GetMonsterPawn().IsAliveAndWell()) { bHasInit = true; ++NumBosses; @@ -67,27 +67,27 @@ final function UpdateBossInfo() local float V; local KFPawn_Monster B; - if(NextBossDistTime1) + if (NumBosses>1) { foreach BossList(B) V += FClamp(float(B.Health) / float(B.HealthMax),0.f,1.f); V /= NumBosses; } - if(LastShield!=V) + if (LastShield!=V) { LastShield = V; SetFloat("currentShieldPercecntValue",V); @@ -104,14 +104,14 @@ final function CheckBestBoss() foreach BossList(B) { Dist = VSizeSq(Pos-B.Location); - if(Best==None || Dist 0 && VSizeSq(DoorEnemy.Location - Pawn.Location) < (DoorMeleeDistance * DoorMeleeDistance)) //200UU + if (DoorEnemy != none && DoorEnemy.Health > 0 && VSizeSq(DoorEnemy.Location - Pawn.Location) < (DoorMeleeDistance * DoorMeleeDistance)) //200UU { `AILog(self$" DoorEnemy: "$DoorEnemy$" starting melee attack", 'Command_Base'); UpdateHistoryString("[Attacking : "$DoorEnemy$" at "$WorldInfo.TimeSeconds$"]"); @@ -69,18 +69,18 @@ Begin: // See if we are close to our owner RecheckOwner: OwnerPawn = Ext_T_MonsterPRI(PlayerReplicationInfo)!=None ? Ext_T_MonsterPRI(PlayerReplicationInfo).OwnerController.Pawn : None; - if(OwnerPawn!=None) + if (OwnerPawn!=None) { - if(Enemy!=None && LineOfSightTo(OwnerPawn) && LineOfSightTo(Enemy)) // We have sight to our owner and can see enemy, go for it! + if (Enemy!=None && LineOfSightTo(OwnerPawn) && LineOfSightTo(Enemy)) // We have sight to our owner and can see enemy, go for it! { OwnerPawn = None; bWaitingOnMovementPlugIn = true; SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving()); NextSightCheckTime = WorldInfo.TimeSeconds+2.f; - while(bWaitingOnMovementPlugIn && bUsePluginsForMovement) + while (bWaitingOnMovementPlugIn && bUsePluginsForMovement) { - if(NextSightCheckTime640000.f || !LineOfSightTo(OwnerPawn)) // 800.f - Need to move closer to our owner. + else if (VSizeSq(OwnerPawn.Location-Pawn.Location)>640000.f || !LineOfSightTo(OwnerPawn)) // 800.f - Need to move closer to our owner. { bWaitingOnMovementPlugIn = true; SetMovePoint(PickPointNearOwner(),OwnerPawn,,300.f); - while(bWaitingOnMovementPlugIn && bUsePluginsForMovement) + while (bWaitingOnMovementPlugIn && bUsePluginsForMovement) { Sleep(0.03); } @@ -104,19 +104,19 @@ RecheckOwner: Sleep(0.2+FRand()*0.5); } } - else if(IsValidAttackTarget(KFPawn(Enemy))) + else if (IsValidAttackTarget(KFPawn(Enemy))) { `AILog("Calling SetEnemyMoveGoal [Dist:"$VSize(Enemy.Location - Pawn.Location)$"] using offset of "$AttackRange$", because IsWithinBasicMeleeRange() returned false ", 'Command_Base'); bWaitingOnMovementPlugIn = true; SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving()); - while(bWaitingOnMovementPlugIn && bUsePluginsForMovement) + while (bWaitingOnMovementPlugIn && bUsePluginsForMovement) { Sleep(0.03); } `AiLog("Back from waiting for the movement plug in!!!"); - if(Enemy == none) + if (Enemy == none) { Sleep(FRand() + 0.1f); Goto('Begin'); @@ -130,9 +130,9 @@ RecheckOwner: // Check combat transitions CheckCombatTransition(); - if(bFailedToMoveToEnemy) + if (bFailedToMoveToEnemy) { - if(bFailedPathfind) + if (bFailedPathfind) { bFailedPathfind = false; Sleep(0.f); diff --git a/ServerExt/Classes/Ext_PerkBase.uc b/ServerExt/Classes/Ext_PerkBase.uc index 6eb2feb..4fc8935 100644 --- a/ServerExt/Classes/Ext_PerkBase.uc +++ b/ServerExt/Classes/Ext_PerkBase.uc @@ -112,7 +112,7 @@ var localized string StatHealRecharge; reliable client simulated function string UIName(FDefPerkStat DefPerkStat) { - switch(DefPerkStat.StatType) + switch (DefPerkStat.StatType) { case name("Speed"): return StatSpeed; case name("Damage"): return StatDamage; @@ -148,10 +148,10 @@ replication simulated final function bool IsWeaponOnPerk(KFWeapon W) { - if(class(BasePerk) != None) + if (class(BasePerk) != None) return true; - //if(W.AllowedForAllPerks()) + //if (W.AllowedForAllPerks()) // return true; return W!=None && W.GetWeaponPerkClass(BasePerk)==BasePerk; @@ -167,7 +167,7 @@ simulated function PostBeginPlay() local int i,j; local class T; - if(WorldInfo.NetMode==NM_Client) + if (WorldInfo.NetMode==NM_Client) { PerkStats.Length = 0; // Prevent client desync with client settings. PlayerOwner = GetALocalPlayerController(); @@ -177,7 +177,7 @@ simulated function PostBeginPlay() { RemoteRole = ROLE_None; // Make sure these actors get replicated in order to client. PlayerOwner = Controller(Owner); - if(PlayerOwner==None) + if (PlayerOwner==None) { `Log(Self@"spawned without owner."); Destroy(); @@ -187,10 +187,10 @@ simulated function PostBeginPlay() // Load trait classes. j = 0; - for(i=0; i(DynamicLoadObject(TraitClasses[i],Class'Class')); - if(T==None || !T.Static.IsEnabled(Self)) + if (T==None || !T.Static.IsEnabled(Self)) continue; PerkTraits.Length = j+1; PerkTraits[j].TraitType = T; @@ -198,16 +198,16 @@ simulated function PostBeginPlay() } // Setup serverside stat info (for XML log files). - for(j=0; j=0) + if (i>=0) PerkStats[j].UIName = UIName(DefPerkStats[i]); else { // Fallback to parent perk for trying to find name. i = Class'Ext_PerkBase'.Default.DefPerkStats.Find('StatType',PerkStats[j].StatType); - if(i>=0) + if (i>=0) PerkStats[j].UIName = UIName(Class'Ext_PerkBase'.Default.DefPerkStats[i]); else PerkStats[j].UIName = string(PerkStats[j].StatType); // Fallback to stat name then... } @@ -216,9 +216,9 @@ simulated function PostBeginPlay() } simulated function InitPerk() { - if(PlayerOwner==None) + if (PlayerOwner==None) PlayerOwner = GetALocalPlayerController(); - if(PerkManager==None) + if (PerkManager==None) { foreach DynamicActors(class'ExtPerkManager',PerkManager) { @@ -231,11 +231,11 @@ simulated function Destroyed() { local int i; - if(PerkManager!=None) + if (PerkManager!=None) PerkManager.UnregisterPerk(Self); - if(WorldInfo.NetMode!=NM_Client) + if (WorldInfo.NetMode!=NM_Client) { - for(i=0; i=0) + if (i>=0) PerkStats[Index].UIName = UIName(DefPerkStats[i]); else { // Fallback to parent perk for trying to find name. i = Class'Ext_PerkBase'.Default.DefPerkStats.Find('StatType',Type); - if(i>=0) + if (i>=0) PerkStats[Index].UIName = UIName(Class'Ext_PerkBase'.Default.DefPerkStats[i]); else PerkStats[Index].UIName = string(Type); // Fallback to stat name then... } } reliable client simulated function ClientSetStatValue(int Index, int NewValue) { - if(PerkStats.Length<=Index) + if (PerkStats.Length<=Index) PerkStats.Length = Index+1; PerkStats[Index].CurrentValue = NewValue; - if(bPerkNetReady) + if (bPerkNetReady) ApplyEffects(); } reliable client simulated function ClientReceiveTrait(int Index, class TC, byte Lvl) { - if(PerkTraits.Length<=Index) + if (PerkTraits.Length<=Index) PerkTraits.Length = Index+1; PerkTraits[Index].TraitType = TC; PerkTraits[Index].CurrentLevel = Lvl; } reliable client simulated function ClientReceiveTraitData(int Index, string Data) { - if(WorldInfo.NetMode==NM_Client) + if (WorldInfo.NetMode==NM_Client) PerkTraits[Index].TraitType.Static.ClientSetRepData(Data); } reliable client simulated function ClientReceiveTraitLvl(int Index, byte NewLevel) @@ -321,7 +321,7 @@ final function SetPerkStat(name Type, int Value) local int i; i = PerkStats.Find('StatType',Type); - if(i>=0) + if (i>=0) PerkStats[i].CurrentValue = Value; } final function int GetPerkStat(name Type) @@ -329,7 +329,7 @@ final function int GetPerkStat(name Type) local int i; i = PerkStats.Find('StatType',Type); - if(i==-1) + if (i==-1) return 0; return PerkStats[i].CurrentValue; } @@ -340,19 +340,19 @@ function bool EarnedEXP(int EXP) bForceNetUpdate = true; CurrentEXP+=EXP; - while(CurrentEXP>=NextLevelEXP && CurrentLevel=NextLevelEXP && CurrentLevel0) + if (n>0) { CurrentSP+=(n*(StarPointsPerLevel+CurrentPrestige*PrestigeSPIncrease)); - if(PerkManager.PRIOwner!=None && PerkManager.CurrentPerk==Self) + if (PerkManager.PRIOwner!=None && PerkManager.CurrentPerk==Self) UpdatePRILevel(); // TODO - broadcast level up messages. - if(ExtPlayerController(PlayerOwner)!=None) + if (ExtPlayerController(PlayerOwner)!=None) ExtPlayerController(PlayerOwner).ReceiveLevelUp(Self,CurrentLevel); } return true; @@ -377,9 +377,9 @@ function OutputXML(ExtStatWriter Data) Data.WriteValue("exptilnext",string(NextLevelEXP)); Data.WriteValue("exponprev",string(LastLevelEXP)); - for(i=0; i0) + if (PerkStats[i].CurrentValue>0) { Data.StartIntendent("stat","type",string(PerkStats[i].StatType)); Data.WriteValue("name",GetStatUIStr(i)); @@ -389,9 +389,9 @@ function OutputXML(ExtStatWriter Data) } } - for(i=0; i0) + if (PerkTraits[i].CurrentLevel>0) { Data.StartIntendent("trait","class",string(PerkTraits[i].TraitType.Name)); Data.WriteValue("name",PerkTraits[i].TraitType.Default.TraitName); @@ -416,15 +416,15 @@ function SaveData(ExtSaveDataBase Data) // Count number of given stats j = 0; - for(i=0; i0) + for (i=0; i0) ++j; // Then perk stats. Data.SaveInt(j); - for(i=0; i0) + if (PerkStats[i].CurrentValue>0) { Data.SaveStr(string(PerkStats[i].StatType)); Data.SaveInt(PerkStats[i].CurrentValue,1); @@ -433,15 +433,15 @@ function SaveData(ExtSaveDataBase Data) // Count bought traits. j = 0; - for(i=0; i0) + for (i=0; i0) ++j; // Then traits. Data.SaveInt(j); - for(i=0; i0) + if (PerkTraits[i].CurrentLevel>0) { Data.SaveStr(string(PerkTraits[i].TraitType)); Data.SaveInt(PerkTraits[i].CurrentLevel); @@ -456,23 +456,23 @@ function LoadData(ExtSaveDataBase Data) local string S; CurrentEXP = Data.ReadInt(3); - // if(MinimalDataLevel > 0) + // if (MinimalDataLevel > 0) // { // i = GetNeededExp(MinimalDataLevel-1) - // if(i > CurrentEXP) + // if (i > CurrentEXP) // CurrentEXP = i // } - if(Data.GetArVer()>=1) + if (Data.GetArVer()>=1) CurrentPrestige = Data.ReadInt(3); l = Data.ReadInt(); // Perk stats length. - for(i=0; i=GetNeededExp(a)) + if (a=GetNeededExp(a)) ++a; break; } i = a+((b-a)>>1); - if(InExp 0) + if (MinimalDataLevel > 0) { i = GetNeededExp(MinimalDataLevel-1); - if(i > CurrentEXP) + if (i > CurrentEXP) CurrentEXP = i; } @@ -536,15 +536,15 @@ function SetInitialLevel() LastLevelEXP = (CurrentLevel>MinimumLevel ? GetNeededExp(CurrentLevel-1) : 0); // Now verify the points player used on individual stats. - for(i=0; i0) + if (PerkStats[i].CurrentValue>0) { PerkStats[i].CurrentValue = Min(PerkStats[i].CurrentValue,PerkStats[i].MaxValue); a = PerkStats[i].CurrentValue*PerkStats[i].CostPerValue; - if(CurrentSP>a) + if (CurrentSP>a) CurrentSP-=a; - else if(CurrentSP<=0) // No points at all for this. + else if (CurrentSP<=0) // No points at all for this. PerkStats[i].CurrentValue = 0; else // Nope, reduce the stat! { @@ -557,78 +557,78 @@ function SetInitialLevel() // Then verify trait levels and costs. MT = 0; - for(i=0; i0) + if (PerkTraits[i].CurrentLevel>0) { PerkTraits[i].CurrentLevel = Min(PerkTraits[i].CurrentLevel,PerkTraits[i].TraitType.Default.NumLevels); - if(PerkTraits[i].TraitType.Default.LoadPriority>0) + if (PerkTraits[i].TraitType.Default.LoadPriority>0) MT = Max(MT,PerkTraits[i].TraitType.Default.LoadPriority); else { - if(!PerkTraits[i].TraitType.Static.MeetsRequirements(PerkTraits[i].CurrentLevel-1,Self)) + if (!PerkTraits[i].TraitType.Static.MeetsRequirements(PerkTraits[i].CurrentLevel-1,Self)) a = 0; else { - for(a=0; aCurrentSP) + if (b>CurrentSP) break; CurrentSP-=b; } } PerkTraits[i].CurrentLevel = a; - if(PerkTraits[i].CurrentLevel>0 && PerkTraits[i].Data==None) - PerkTraits[i].Data = PerkTraits[i].TraitType.Static.InitializeFor(Self,ExtPlayerController(Owner)); + if (PerkTraits[i].CurrentLevel>0 && PerkTraits[i].Data==None) + PerkTraits[i].Data = PerkTraits[i].TraitType.Static.Initializefor (Self,ExtPlayerController(Owner)); } } - if(PerkTraits[i].CurrentLevel==0 && PerkTraits[i].Data!=None) + if (PerkTraits[i].CurrentLevel==0 && PerkTraits[i].Data!=None) PerkTraits[i].TraitType.Static.CleanupTrait(ExtPlayerController(Owner),Self,PerkTraits[i].Data); } // Delayed loads. - for(j=1; j<=MT; ++j) + for (j=1; j<=MT; ++j) { - for(i=0; i0 && PerkTraits[i].TraitType.Default.LoadPriority==j) + if (PerkTraits[i].CurrentLevel>0 && PerkTraits[i].TraitType.Default.LoadPriority==j) { - if(!PerkTraits[i].TraitType.Static.MeetsRequirements(PerkTraits[i].CurrentLevel-1,Self)) + if (!PerkTraits[i].TraitType.Static.MeetsRequirements(PerkTraits[i].CurrentLevel-1,Self)) a = 0; else { - for(a=0; aCurrentSP) + if (b>CurrentSP) break; CurrentSP-=b; } } PerkTraits[i].CurrentLevel = a; - if(PerkTraits[i].CurrentLevel>0 && PerkTraits[i].Data==None) - PerkTraits[i].Data = PerkTraits[i].TraitType.Static.InitializeFor(Self,ExtPlayerController(Owner)); + if (PerkTraits[i].CurrentLevel>0 && PerkTraits[i].Data==None) + PerkTraits[i].Data = PerkTraits[i].TraitType.Static.Initializefor (Self,ExtPlayerController(Owner)); } - if(PerkTraits[i].CurrentLevel==0 && PerkTraits[i].Data!=None) + if (PerkTraits[i].CurrentLevel==0 && PerkTraits[i].Data!=None) PerkTraits[i].TraitType.Static.CleanupTrait(ExtPlayerController(Owner),Self,PerkTraits[i].Data); } } ApplyEffects(); - if(PerkManager.CurrentPerk==Self) + if (PerkManager.CurrentPerk==Self) ActivateTraits(); } // Check the needed amount of EXP for a perk. function int GetNeededExp(int LevelNum) { - if(LevelNum=MaximumLevel) + if (LevelNum=MaximumLevel) return 0; LevelNum-=MinimumLevel; LevelNum = (FirstLevelExp+(LevelNum*LevelUpExpCost)+(LevelNum*LevelNum*LevelUpIncCost)); - if(CurrentPrestige>0 && PrestigeXPReduce>0) + if (CurrentPrestige>0 && PrestigeXPReduce>0) LevelNum *= (1.f / (1.f + PrestigeXPReduce*CurrentPrestige)); return LevelNum; } @@ -639,16 +639,16 @@ static function CheckConfig() local int i; local class T; - if(Default.ConfigVersion!=Default.CurrentConfigVer) + if (Default.ConfigVersion!=Default.CurrentConfigVer) { UpdateConfigs(Default.ConfigVersion); Default.ConfigVersion = Default.CurrentConfigVer; StaticSaveConfig(); } - for(i=0; i(DynamicLoadObject(Default.TraitClasses[i],Class'Class')); - if(T!=None) + if (T!=None) T.Static.CheckConfig(); } } @@ -656,7 +656,7 @@ static function UpdateConfigs(int OldVer) { local int i,j; - if(OldVer==0) + if (OldVer==0) { Default.FirstLevelExp = 400; Default.LevelUpExpCost = 500; @@ -675,34 +675,34 @@ static function UpdateConfigs(int OldVer) Default.PerkStats.Length = 0; AddStatsCfg(0); Default.TraitClasses.Length = Default.DefTraitList.Length; - for(i=0; i=0) + if (j>=0) Default.PerkStats[i].Progress = Default.DefPerkStats[j].Progress; } // Add off-perk damage stat. AddStatsCfg(12); } - else if(OldVer<=3) + else if (OldVer<=3) AddStatsCfg(13); // Add self damage. - else if(OldVer<=4) + else if (OldVer<=4) AddStatsCfg(15); // Add poison damage. - else if(OldVer<=7) + else if (OldVer<=7) AddStatsCfg(16); // Add sonic/fire damage. - else if(OldVer<=12) + else if (OldVer<=12) AddStatsCfg(18); // Add all damage. - else if(OldVer<=13) + else if (OldVer<=13) AddStatsCfg(19); // Add HeadDamage and HealRecharge - if(OldVer<=5) + if (OldVer<=5) { // Add prestige Default.MinLevelForPrestige = 140; @@ -712,7 +712,7 @@ static function UpdateConfigs(int OldVer) } Default.TraitClasses.Length = Default.DefTraitList.Length; - for(i=0; i=0) // Don't add if already found for some reason. + if (Default.DefPerkStats[i].bHiddenConfig || Default.PerkStats.Find('StatType',Default.DefPerkStats[i].StatType)>=0) // Don't add if already found for some reason. continue; Default.PerkStats.Length = j+1; Default.PerkStats[j].MaxValue = Default.DefPerkStats[i].MaxValue; @@ -742,17 +742,17 @@ static function InitWebAdmin(ExtWebAdmin_UI UI) UI.AddSettingsPage("Perk "$Default.PerkName,Default.Class,Default.WebConfigs,GetValue,ApplyValue); - for(i=0; i(DynamicLoadObject(Default.TraitClasses[i],Class'Class')); - if(T==None || UI.HasConfigFor(T)) + if (T==None || UI.HasConfigfor (T)) continue; T.Static.InitWebAdmin(UI); } } static function string GetValue(name PropName, int ElementIndex) { - switch(PropName) + switch (PropName) { case 'FirstLevelExp': return string(Default.FirstLevelExp); @@ -784,7 +784,7 @@ static function string GetValue(name PropName, int ElementIndex) } static function ApplyValue(name PropName, int ElementIndex, string Value) { - switch(PropName) + switch (PropName) { case 'FirstLevelExp': Default.FirstLevelExp = int(Value); break; @@ -801,21 +801,21 @@ static function ApplyValue(name PropName, int ElementIndex, string Value) case 'StarPointsPerLevel': Default.StarPointsPerLevel = int(Value); break; case 'TraitClasses': - if(Value=="#DELETE") + if (Value=="#DELETE") Default.TraitClasses.Remove(ElementIndex,1); else { - if(ElementIndex>=Default.TraitClasses.Length) + if (ElementIndex>=Default.TraitClasses.Length) Default.TraitClasses.Length = ElementIndex+1; Default.TraitClasses[ElementIndex] = Value; } break; case 'PerkStats': - if(Value=="#DELETE") + if (Value=="#DELETE") Default.PerkStats.Remove(ElementIndex,1); else { - if(ElementIndex>=Default.PerkStats.Length) + if (ElementIndex>=Default.PerkStats.Length) Default.PerkStats.Length = ElementIndex+1; Default.PerkStats[ElementIndex] = ParsePerkStatStr(Value); } @@ -839,17 +839,17 @@ static final function FPerkStat ParsePerkStatStr(string S) local int i; i = InStr(S,","); - if(i==-1) + if (i==-1) return Res; Res.StatType = name(Left(S,i)); S = Mid(S,i+1); i = InStr(S,","); - if(i==-1) + if (i==-1) return Res; Res.MaxValue = int(Left(S,i)); S = Mid(S,i+1); i = InStr(S,","); - if(i==-1) + if (i==-1) return Res; Res.CostPerValue = int(Left(S,i)); Res.Progress = float(Mid(S,i+1)); @@ -860,7 +860,7 @@ static final function FPerkStat ParsePerkStatStr(string S) function bool IncrementStat(int iStat, int Amount) { PerkStats[iStat].CurrentValue+=Amount; - if(bOwnerNetClient) + if (bOwnerNetClient) ClientSetStatValue(iStat,PerkStats[iStat].CurrentValue); PerkManager.bStatsDirty = true; ApplyEffects(); @@ -872,9 +872,9 @@ simulated function ApplyEffects() { local int i; - for(i=0; i0) + if (PerkTraits[i].CurrentLevel>0) { - if(PerkTraits[i].TraitType.Default.bPostApplyEffect) + if (PerkTraits[i].TraitType.Default.bPostApplyEffect) bSec = true; else PerkTraits[i].TraitType.Static.ApplyEffectOn(P,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } - if(bSec) + if (bSec) { - for(i=0; i0 && PerkTraits[i].TraitType.Default.bPostApplyEffect) + if (PerkTraits[i].CurrentLevel>0 && PerkTraits[i].TraitType.Default.bPostApplyEffect) PerkTraits[i].TraitType.Static.ApplyEffectOn(P,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } @@ -915,27 +915,27 @@ function ActivateTraits() local bool bSec; KFP = KFPawn_Human(PlayerOwner.Pawn); - if(KFP!=None && !KFP.IsAliveAndWell()) + if (KFP!=None && !KFP.IsAliveAndWell()) KFP = None; - for(i=0; i0) + if (PerkTraits[i].CurrentLevel>0) { PerkTraits[i].TraitType.Static.TraitActivate(Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); - if(KFP!=None) + if (KFP!=None) { - if(PerkTraits[i].TraitType.Default.bPostApplyEffect) + if (PerkTraits[i].TraitType.Default.bPostApplyEffect) bSec = true; else PerkTraits[i].TraitType.Static.ApplyEffectOn(KFP,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } } - if(bSec) + if (bSec) { - for(i=0; i0 && PerkTraits[i].TraitType.Default.bPostApplyEffect) + if (PerkTraits[i].CurrentLevel>0 && PerkTraits[i].TraitType.Default.bPostApplyEffect) PerkTraits[i].TraitType.Static.ApplyEffectOn(KFP,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } @@ -946,22 +946,22 @@ function DeactivateTraits() { local int i; - for(i=0; i0) + if (PerkTraits[i].CurrentLevel>0) PerkTraits[i].TraitType.Static.TraitDeActivate(Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } simulated unreliable client function ClientAuth() { - if(Owner==None) + if (Owner==None) SetOwner(PlayerOwner); ServerAck(); } unreliable server function ServerAck() { - if(!bClientAuthorized) + if (!bClientAuthorized) { bClientAuthorized = true; RepState = 0; @@ -971,10 +971,10 @@ unreliable server function ServerAck() } function ReplicateTimer() { - switch(RepState) + switch (RepState) { case 0: // Send all perk stats - if(RepIndex>=PerkStats.Length) + if (RepIndex>=PerkStats.Length) { ++RepState; RepIndex = 0; @@ -986,7 +986,7 @@ function ReplicateTimer() } break; case 1: // Send all traits - if(RepIndex>=PerkTraits.Length) + if (RepIndex>=PerkTraits.Length) ++RepState; else { @@ -1015,9 +1015,9 @@ simulated function string GetStatUIStr(int iStat) bLoop = true; // Chop off float digits that aren't needed. - while(bLoop) + while (bLoop) { - switch(Right(S,1)) + switch (Right(S,1)) { case "0": S = Left(S,Len(S)-1); @@ -1039,43 +1039,43 @@ final function UnloadStats(optional byte Mode) local KFPawn_Human KFP; PerkManager.bStatsDirty = true; - if(Mode<=1) + if (Mode<=1) { // Reset stats. - for(i=0; i0) + if (PerkStats[i].CurrentValue>0) { CurrentSP+=(PerkStats[i].CurrentValue*PerkStats[i].CostPerValue); PerkStats[i].CurrentValue = 0; - if(bOwnerNetClient) + if (bOwnerNetClient) ClientSetStatValue(i,0); } } ApplyEffects(); } - if(Mode==0 || Mode==2) + if (Mode==0 || Mode==2) { KFP = KFPawn_Human(PlayerOwner.Pawn); - if(KFP!=None && !KFP.IsAliveAndWell()) + if (KFP!=None && !KFP.IsAliveAndWell()) KFP = None; // Reset traits. - for(i=0; i0) + if (PerkTraits[i].CurrentLevel>0) { - for(j=0; j0 && PerkTraits[i].TraitType.Default.bHighPriorityDeath && PerkTraits[i].TraitType.Static.PreventDeath(Player,Killer,DamType,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data)) + if (PerkTraits[i].CurrentLevel>0 && PerkTraits[i].TraitType.Default.bHighPriorityDeath && PerkTraits[i].TraitType.Static.PreventDeath(Player,Killer,DamType,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data)) return true; } - for(i=0; i0 && !PerkTraits[i].TraitType.Default.bHighPriorityDeath && PerkTraits[i].TraitType.Static.PreventDeath(Player,Killer,DamType,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data)) + if (PerkTraits[i].CurrentLevel>0 && !PerkTraits[i].TraitType.Default.bHighPriorityDeath && PerkTraits[i].TraitType.Static.PreventDeath(Player,Killer,DamType,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data)) return true; } return false; @@ -1125,11 +1125,11 @@ simulated function PlayerDied() { local int i; - if(WorldInfo.NetMode!=NM_Client) + if (WorldInfo.NetMode!=NM_Client) { - for(i=0; i0) + if (PerkTraits[i].CurrentLevel>0) PerkTraits[i].TraitType.Static.PlayerDied(Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } @@ -1141,7 +1141,7 @@ simulated function float ApplyEffect(name Type, float Value, float Progress) local bool bActivePerk; bActivePerk = (PerkManager!=None && PerkManager.CurrentPerk==Self); - switch(Type) + switch (Type) { case 'Speed': Modifiers[0] = 1.f + (Value*Progress); @@ -1163,7 +1163,7 @@ simulated function float ApplyEffect(name Type, float Value, float Progress) break; case 'Health': Modifiers[6] = 1.f + (Value*Progress); - if(bActivePerk && PlayerOwner.Pawn!=None) + if (bActivePerk && PlayerOwner.Pawn!=None) { PlayerOwner.Pawn.HealthMax = PlayerOwner.Pawn.Default.Health; ModifyHealth(PlayerOwner.Pawn.HealthMax); @@ -1180,12 +1180,12 @@ simulated function float ApplyEffect(name Type, float Value, float Progress) break; case 'Mag': Modifiers[10] = 1.f + (Value*Progress); - if(bActivePerk && WorldInfo.NetMode!=NM_Client && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.InvManager!=None) + if (bActivePerk && WorldInfo.NetMode!=NM_Client && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.InvManager!=None) UpdateAmmoStatus(PlayerOwner.Pawn.InvManager); break; case 'Spare': Modifiers[11] = 1.f + (Value*Progress); - if(bActivePerk && WorldInfo.NetMode!=NM_Client && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.InvManager!=None) + if (bActivePerk && WorldInfo.NetMode!=NM_Client && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.InvManager!=None) UpdateAmmoStatus(PlayerOwner.Pawn.InvManager); break; case 'OffDamage': @@ -1196,7 +1196,7 @@ simulated function float ApplyEffect(name Type, float Value, float Progress) break; case 'Armor': Modifiers[14] = (Value*Progress*100.f); - if(bActivePerk && KFPawn_Human(PlayerOwner.Pawn)!=None) + if (bActivePerk && KFPawn_Human(PlayerOwner.Pawn)!=None) { KFPawn_Human(PlayerOwner.Pawn).MaxArmor = KFPawn_Human(PlayerOwner.Pawn).Default.MaxArmor; ModifyArmor(KFPawn_Human(PlayerOwner.Pawn).MaxArmor); @@ -1226,35 +1226,35 @@ simulated function float ApplyEffect(name Type, float Value, float Progress) simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { - if(BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser)))) + if (BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser)))) { - if(HitZoneIdx == 0) + if (HitZoneIdx == 0) InDamage *= (Modifiers[1] + Modifiers[19]); else InDamage *= Modifiers[1]; } - else if(DamageType==None || DamageType.Name!='KFDT_SuicideExplosive') + else if (DamageType==None || DamageType.Name!='KFDT_SuicideExplosive') InDamage *= Modifiers[12]; } simulated function ModifyDamageTaken(out int InDamage, optional class DamageType, optional Controller InstigatedBy) { - if(InDamage>0) + if (InDamage>0) { - if((InstigatedBy==None || InstigatedBy==PlayerOwner) && class(DamageType)!=None) + if ((InstigatedBy==None || InstigatedBy==PlayerOwner) && class(DamageType)!=None) InDamage *= Modifiers[13]; - else if(Modifiers[15]<1 && class(DamageType)!=None) + else if (Modifiers[15]<1 && class(DamageType)!=None) InDamage = Max(InDamage*Modifiers[15],1); // Do at least 1 damage. - else if(Modifiers[16]<1 && class(DamageType)!=None) + else if (Modifiers[16]<1 && class(DamageType)!=None) InDamage = Max(InDamage*Modifiers[16],1); - else if(Modifiers[17]<1 && class(DamageType)!=None) + else if (Modifiers[17]<1 && class(DamageType)!=None) InDamage = Max(InDamage*Modifiers[17],1); - if(Modifiers[18]<1 && InstigatedBy!=None && InstigatedBy!=PlayerOwner) + if (Modifiers[18]<1 && InstigatedBy!=None && InstigatedBy!=PlayerOwner) InDamage = Max(InDamage*Modifiers[18],1); } } simulated function ModifyRecoil(out float CurrentRecoilModifier, KFWeapon KFW) { - if(IsWeaponOnPerk(KFW)) + if (IsWeaponOnPerk(KFW)) CurrentRecoilModifier *= Modifiers[2]; } simulated function ModifySpread(out float InSpread) @@ -1263,7 +1263,7 @@ simulated function ModifySpread(out float InSpread) } simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW) { - if(IsWeaponOnPerk(KFW)) + if (IsWeaponOnPerk(KFW)) InRate *= Modifiers[4]; } simulated function float GetReloadRateScale(KFWeapon KFW) @@ -1293,15 +1293,15 @@ function AddDefaultInventory(KFPawn P) { local int i; - if(PrimaryWeapon!=None) + if (PrimaryWeapon!=None) P.DefaultInventory.AddItem(PrimaryWeapon); P.DefaultInventory.AddItem(PrimaryMelee); - if(KFInventoryManager(P.InvManager)!=None) + if (KFInventoryManager(P.InvManager)!=None) KFInventoryManager(P.InvManager).MaxCarryBlocks = KFInventoryManager(P.InvManager).Default.MaxCarryBlocks+Modifiers[10]; - for(i=0; i0) + if (PerkTraits[i].CurrentLevel>0) PerkTraits[i].TraitType.Static.AddDefaultInventory(P,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } @@ -1323,12 +1323,12 @@ function bool ModifyHealAmount(out float HealAmount) } simulated function ModifyMagSizeAndNumber(KFWeapon KFW, out int MagazineCapacity, optional array< Class > WeaponPerkClass, optional bool bSecondary=false, optional name WeaponClassname) { - if(MagazineCapacity>2 && (KFW==None ? WeaponPerkClass.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW))) // Skip boomstick for this. + if (MagazineCapacity>2 && (KFW==None ? WeaponPerkClass.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW))) // Skip boomstick for this. MagazineCapacity = Min(MagazineCapacity*Modifiers[10],255); } simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary) { - if(KFW==None ? TraderItem.AssociatedPerkClasses.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW)) + if (KFW==None ? TraderItem.AssociatedPerkClasses.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW)) PrimarySpareAmmo*=Modifiers[11]; } simulated function bool ShouldMagSizeModifySpareAmmo(KFWeapon KFW, optional Class WeaponPerkClass) @@ -1342,7 +1342,7 @@ final function UpdateAmmoStatus(InventoryManager Inv) foreach Inv.InventoryActors(class'KFWeapon',W) { - if(IsWeaponOnPerk(W)) + if (IsWeaponOnPerk(W)) W.ReInitializeAmmoCounts(PerkManager); } } @@ -1354,7 +1354,7 @@ simulated function ModifyHealerRechargeTime(out float RechargeRate) simulated function DrawSpecialPerkHUD(Canvas C) { - if(EnemyHealthRange>0 && PlayerOwner!=None && KFPawn_Human(PlayerOwner.Pawn)!=None) + if (EnemyHealthRange>0 && PlayerOwner!=None && KFPawn_Human(PlayerOwner.Pawn)!=None) DrawEnemyHealth(C); } @@ -1368,7 +1368,7 @@ simulated final function DrawEnemyHealth(Canvas C) foreach WorldInfo.AllPawns(class'KFPawn_Monster',KFPM,CameraLocation,EnemyDistDraw[EnemyHealthRange-1]) { - if(KFPM.IsAliveAndWell() && `TimeSince(KFPM.Mesh.LastRenderTime)<0.1f && KFPM.CanShowHealth() && KFPM.GetTeamNum()!=0 && (X Dot (KFPM.Location - CameraLocation))>0) + if (KFPM.IsAliveAndWell() && `TimeSince(KFPM.Mesh.LastRenderTime)<0.1f && KFPM.CanShowHealth() && KFPM.GetTeamNum()!=0 && (X Dot (KFPM.Location - CameraLocation))>0) DrawZedHealthbar(C,KFPM,CameraLocation); } } @@ -1382,7 +1382,7 @@ simulated final function DrawZedHealthbar(Canvas C, KFPawn_Monster KFPM, vector HealthbarHeight = FMin(6.f * (float(C.SizeX) / 1024.f), 6.f) * class'KFGFxHudWrapper'.Default.FriendlyHudScale; HealthScale = FClamp(float(KFPM.Health) / float(KFPM.HealthMax),0.f,1.f); - if(KFPM.bCrawler && KFPM.Floor.Z <= -0.7f && KFPM.Physics == PHYS_Spider) + if (KFPM.bCrawler && KFPM.Floor.Z <= -0.7f && KFPM.Physics == PHYS_Spider) { TargetLocation = KFPM.Location + vect(0,0,-1) * KFPM.GetCollisionHeight() * 1.2; } @@ -1392,7 +1392,7 @@ simulated final function DrawZedHealthbar(Canvas C, KFPawn_Monster KFPM, vector } ScreenPos = C.Project(TargetLocation); - if(ScreenPos.X < 0 || ScreenPos.X > C.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > C.SizeY || !FastTrace(TargetLocation, CameraLocation)) + if (ScreenPos.X < 0 || ScreenPos.X > C.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > C.SizeY || !FastTrace(TargetLocation, CameraLocation)) return; C.EnableStencilTest(true); diff --git a/ServerExt/Classes/Ext_PerkBerserker.uc b/ServerExt/Classes/Ext_PerkBerserker.uc index 81374c2..8a2d59c 100644 --- a/ServerExt/Classes/Ext_PerkBerserker.uc +++ b/ServerExt/Classes/Ext_PerkBerserker.uc @@ -12,22 +12,22 @@ replication simulated function ModifyMeleeAttackSpeed(out float InDuration) { InDuration *= Modifiers[4]; - if(ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f) + if (ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f) InDuration *= ZedTimeMeleeAtkRate; } simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW) { - if(IsWeaponOnPerk(KFW)) + if (IsWeaponOnPerk(KFW)) { InRate *= Modifiers[4]; - if(ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f) + if (ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f) InRate *= ZedTimeMeleeAtkRate; } } function PlayerKilled(KFPawn_Monster Victim, class DT) { - if(VampRegenRate>0 && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health>0 && class(DT)!=None && class(DT).Default.ModifierPerkList.Find(BasePerk)>=0) + if (VampRegenRate>0 && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health>0 && class(DT)!=None && class(DT).Default.ModifierPerkList.Find(BasePerk)>=0) PlayerOwner.Pawn.HealDamage(Max(PlayerOwner.Pawn.HealthMax*VampRegenRate,1), PlayerOwner, class'KFDT_Healing', false, false); } diff --git a/ServerExt/Classes/Ext_PerkCommando.uc b/ServerExt/Classes/Ext_PerkCommando.uc index 17ebf49..94f78c0 100644 --- a/ServerExt/Classes/Ext_PerkCommando.uc +++ b/ServerExt/Classes/Ext_PerkCommando.uc @@ -17,9 +17,9 @@ simulated function bool GetUsingTactialReload(KFWeapon KFW) simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { - if((DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser)))) + if ((DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser)))) { - if(bUseMachineGunner && WorldInfo.TimeDilation < 1.f) + if (bUseMachineGunner && WorldInfo.TimeDilation < 1.f) InDamage += InDamage * 0.03; } @@ -31,15 +31,15 @@ simulated function float GetZedTimeModifier(KFWeapon W) local name StateName; StateName = W.GetStateName(); - if(bUseProfessional && IsWeaponOnPerk(W)) + if (bUseProfessional && IsWeaponOnPerk(W)) { - if(StateName == 'Reloading' || StateName == 'AltReloading') + if (StateName == 'Reloading' || StateName == 'AltReloading') return 1.f; - else if(StateName == 'WeaponPuttingDown' || StateName == 'WeaponEquipping') + else if (StateName == 'WeaponPuttingDown' || StateName == 'WeaponEquipping') return 0.3f; } - if(bUseMachineGunner && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(StateName) != INDEX_NONE) + if (bUseMachineGunner && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(StateName) != INDEX_NONE) return 0.5f; return 0.f; diff --git a/ServerExt/Classes/Ext_PerkDemolition.uc b/ServerExt/Classes/Ext_PerkDemolition.uc index 0246162..4d3497b 100644 --- a/ServerExt/Classes/Ext_PerkDemolition.uc +++ b/ServerExt/Classes/Ext_PerkDemolition.uc @@ -29,7 +29,7 @@ simulated function float ApplyEffect(name Type, float Value, float Progress) DefValue = Super.ApplyEffect(Type, Value, Progress); MyPRI = KFPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo); - if(MyPRI != None && Type == 'KnockDown') + if (MyPRI != None && Type == 'KnockDown') MyPRI.bConcussiveActive = Modifiers[7] > 1.5; return DefValue; @@ -42,16 +42,16 @@ function OnWaveEnded() simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { - if(BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser)))) + if (BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser)))) { - if(bDirectHit && class(DamageType) != none) + if (bDirectHit && class(DamageType) != none) InDamage *= 1.25; - if(bCriticalHit && MyKFPM != none && IsCriticalHitZone(MyKFPM, HitZoneIdx)) + if (bCriticalHit && MyKFPM != none && IsCriticalHitZone(MyKFPM, HitZoneIdx)) InDamage *= 1.5f; } - if(class(DamageType) != None) + if (class(DamageType) != None) InDamage *= NukeDamageMult; Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx); @@ -59,7 +59,7 @@ simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCaus function bool IsCriticalHitZone(KFPawn TestPawn, int HitZoneIndex) { - if(TestPawn != none && HitzoneIndex >= 0 && HitzoneIndex < TestPawn.HitZones.length) + if (TestPawn != none && HitzoneIndex >= 0 && HitzoneIndex < TestPawn.HitZones.length) return TestPawn.HitZones[HitZoneIndex].DmgScale > 1.f; return false; @@ -67,7 +67,7 @@ function bool IsCriticalHitZone(KFPawn TestPawn, int HitZoneIndex) simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary) { - if(KFW != None && KFWeap_Thrown_C4(KFW) != None) + if (KFW != None && KFWeap_Thrown_C4(KFW) != None) PrimarySpareAmmo += (1 + Modifiers[11]); Super.ModifySpareAmmoAmount(KFW, PrimarySpareAmmo, TraderItem, bSecondary); diff --git a/ServerExt/Classes/Ext_PerkFieldMedic.uc b/ServerExt/Classes/Ext_PerkFieldMedic.uc index 3d8ab5f..cce3b0f 100644 --- a/ServerExt/Classes/Ext_PerkFieldMedic.uc +++ b/ServerExt/Classes/Ext_PerkFieldMedic.uc @@ -18,7 +18,7 @@ simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCaus TempDamage = InDamage; - if(bUseSlug && WorldInfo.TimeDilation < 1.f && DamageType != none && ClassIsChildOf(DamageType, class'KFDT_Toxic')) + if (bUseSlug && WorldInfo.TimeDilation < 1.f && DamageType != none && ClassIsChildOf(DamageType, class'KFDT_Toxic')) TempDamage += InDamage * 100; InDamage = Round(TempDamage); @@ -28,7 +28,7 @@ simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCaus simulated function ModifyMagSizeAndNumber(KFWeapon KFW, out int MagazineCapacity, optional array< Class > WeaponPerkClass, optional bool bSecondary=false, optional name WeaponClassname) { - if(MagazineCapacity>2 && (KFW==None ? WeaponPerkClass.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW))) // Skip boomstick for this. + if (MagazineCapacity>2 && (KFW==None ? WeaponPerkClass.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW))) // Skip boomstick for this. MagazineCapacity = Min(MagazineCapacity*Modifiers[10], bSecondary ? 150 : 255); } @@ -36,10 +36,10 @@ function bool RepairArmor(Pawn HealTarget) { local KFPawn_Human KFPH; - if(RepairArmorRate>0) + if (RepairArmorRate>0) { KFPH = KFPawn_Human(Healtarget); - if(KFPH != none && KFPH.Armor < KFPH.MaxArmor) + if (KFPH != none && KFPH.Armor < KFPH.MaxArmor) { KFPH.AddArmor(Round(float(KFPH.MaxArmor) * RepairArmorRate)); return true; @@ -62,7 +62,7 @@ function bool ModifyHealAmount(out float HealAmount) function CheckForAirborneAgent(KFPawn HealTarget, class DamType, int HealAmount) { - if((AirborneAgentLevel==1 && WorldInfo.TimeDilation<1.f) || AirborneAgentLevel>1) + if ((AirborneAgentLevel==1 && WorldInfo.TimeDilation<1.f) || AirborneAgentLevel>1) GiveMedicAirborneAgentHealth(HealTarget, DamType, HealAmount); } @@ -75,7 +75,7 @@ function GiveMedicAirborneAgentHealth(KFPawn HealTarget, class DamTy foreach WorldInfo.Allpawns(class'KFPawn', KFP, HealTarget.Location, 500.f) { - if(KFP.IsAliveAndWell() && WorldInfo.GRI.OnSameTeam(HealTarget, KFP)) + if (KFP.IsAliveAndWell() && WorldInfo.GRI.OnSameTeam(HealTarget, KFP)) { if (HealTarget == KFP) KFP.HealDamage(RoundedExtraHealAmount, PlayerOwner, DamType); @@ -103,13 +103,13 @@ function NotifyZedTimeStarted() HPawn = KFPawn_Human(PlayerOwner.Pawn); - if(bUseAirborneAgent && HPawn != none && HPawn.IsAliveAndWell()) + if (bUseAirborneAgent && HPawn != none && HPawn.IsAliveAndWell()) HPawn.StartAirBorneAgentEvent(); } simulated function float GetSnarePower(optional class DamageType, optional byte HitZoneIdx) { - if(bUseSlug && WorldInfo.TimeDilation < 1.f && class(DamageType)!=None && class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0) + if (bUseSlug && WorldInfo.TimeDilation < 1.f && class(DamageType)!=None && class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0) return 100; return 0.f; @@ -119,7 +119,7 @@ function AddDefaultInventory(KFPawn P) { local int i; i = P.DefaultInventory.Find(class'ExtWeap_Pistol_9mm'); - if(i != -1) + if (i != -1) P.DefaultInventory[i] = class'ExtWeap_Pistol_MedicS'; super.AddDefaultInventory(P); } diff --git a/ServerExt/Classes/Ext_PerkGunslinger.uc b/ServerExt/Classes/Ext_PerkGunslinger.uc index e5a24e6..2cd5f6b 100644 --- a/ServerExt/Classes/Ext_PerkGunslinger.uc +++ b/ServerExt/Classes/Ext_PerkGunslinger.uc @@ -23,10 +23,10 @@ simulated function float GetZedTimeModifier(KFWeapon W) { local name StateName; - if(bHasFanfire && IsWeaponOnPerk(W)) + if (bHasFanfire && IsWeaponOnPerk(W)) { StateName = W.GetStateName(); - if(BasePerk.Default.ZedTimeModifyingStates.Find(StateName) != INDEX_NONE || StateName == 'Reloading') + if (BasePerk.Default.ZedTimeModifyingStates.Find(StateName) != INDEX_NONE || StateName == 'Reloading') return 1.f; } diff --git a/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc b/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc index 7f8062a..317f88a 100644 --- a/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc +++ b/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc @@ -7,7 +7,7 @@ var private const float HeadShotCountdownIntervall; simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { Super.ModifyDamageGiven(InDamage,DamageCauser,MyKFPM,DamageInstigator,DamageType,HitZoneIdx); - if(RhythmComboDmg>0 && BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || IsWeaponOnPerk(KFWeapon(DamageCauser))) + if (RhythmComboDmg>0 && BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || IsWeaponOnPerk(KFWeapon(DamageCauser))) InDamage *= (1.f+RhythmComboDmg); } @@ -25,7 +25,7 @@ final function ResetRhythm() function SubstractHeadShotCombo() { - if(HeadShotComboCount > 0) + if (HeadShotComboCount > 0) UpdateDmgScale(false); else ClearTimer(nameOf(SubstractHeadShotCombo)); @@ -33,13 +33,13 @@ function SubstractHeadShotCombo() final function UpdateDmgScale(bool bUp) { - if(bUp) + if (bUp) { HeadShotComboCount = Min(HeadShotComboCount+1,MaxRhythmCombo); HeadShotMessage(HeadShotComboCount,false,MaxRhythmCombo); SetTimer(HeadShotCountdownIntervall, true, nameOf(SubstractHeadShotCombo)); } - else if(HeadShotComboCount>0) + else if (HeadShotComboCount>0) { --HeadShotComboCount; HeadShotMessage(HeadShotComboCount,true,MaxRhythmCombo); @@ -53,16 +53,16 @@ function UpdatePerkHeadShots(ImpactInfo Impact, class DamageType, in local int HitZoneIdx; local KFPawn_Monster KFPM; - if(MaxRhythmCombo<=0) + if (MaxRhythmCombo<=0) return; KFPM = KFPawn_Monster(Impact.HitActor); - if(KFPM==none || KFPM.GetTeamNum()==0) + if (KFPM==none || KFPM.GetTeamNum()==0) return; HitZoneIdx = KFPM.HitZones.Find('ZoneName', Impact.HitInfo.BoneName); - if(HitZoneIdx == HZI_Head && KFPM.IsAliveAndWell()) + if (HitZoneIdx == HZI_Head && KFPM.IsAliveAndWell()) { - if(class(DamageType)!=None && (class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0)) + if (class(DamageType)!=None && (class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0)) UpdateDmgScale(true); } } @@ -72,7 +72,7 @@ reliable client function HeadShotMessage(byte HeadShotNum, bool bMissed, byte Ma local KFPlayerController PC; PC = KFPlayerController(PlayerOwner); - if(PC==none || PC.MyGFxHUD==none) + if (PC==none || PC.MyGFxHUD==none) { return; } @@ -80,24 +80,24 @@ reliable client function HeadShotMessage(byte HeadShotNum, bool bMissed, byte Ma PC.MyGFxHUD.RhythmCounterWidget.SetInt("count", HeadShotNum); PC.MyGFxHUD.RhythmCounterWidget.SetBonusPercentage(float(HeadShotNum) / float(MaxHits)); - if(HeadshotNum==0) + if (HeadshotNum==0) TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Reset'; - else if(HeadShotNum DamageType, optional byte HitZoneIdx) { - if(ZEDTimeStunPower>0 && HitZoneIdx==HZI_Head && WorldInfo.TimeDilation<1.f && (class(DamageType)!=None && class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0)) + if (ZEDTimeStunPower>0 && HitZoneIdx==HZI_Head && WorldInfo.TimeDilation<1.f && (class(DamageType)!=None && class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0)) return Super.GetStunPowerModifier(DamageType,HitZoneIdx) + ZEDTimeStunPower; return Super.GetStunPowerModifier(DamageType,HitZoneIdx); } diff --git a/ServerExt/Classes/Ext_PerkSupport.uc b/ServerExt/Classes/Ext_PerkSupport.uc index 4910896..bd7dcff 100644 --- a/ServerExt/Classes/Ext_PerkSupport.uc +++ b/ServerExt/Classes/Ext_PerkSupport.uc @@ -23,7 +23,7 @@ simulated function bool CanRepairDoors() simulated function float GetPenetrationModifier(byte Level, class DamageType, optional bool bForce ) { local float PenetrationPower; - if(!bForce && (DamageType == none || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk) == INDEX_NONE))) + if (!bForce && (DamageType == none || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk) == INDEX_NONE))) return 0; PenetrationPower = bUseAPShot ? APShotMul : 0.f; diff --git a/ServerExt/Classes/Ext_TGroupBase.uc b/ServerExt/Classes/Ext_TGroupBase.uc index 58a13ca..b94dbba 100644 --- a/ServerExt/Classes/Ext_TGroupBase.uc +++ b/ServerExt/Classes/Ext_TGroupBase.uc @@ -19,10 +19,10 @@ static function bool GroupLimited(Ext_PerkBase Perk, class Trait) { local int i; - if(Default.bLimitToOne) + if (Default.bLimitToOne) { - for(i=0; i0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class) + for (i=0; i0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class) return true; } return false; diff --git a/ServerExt/Classes/Ext_TGroupRegen.uc b/ServerExt/Classes/Ext_TGroupRegen.uc index 0d71909..3633b1a 100644 --- a/ServerExt/Classes/Ext_TGroupRegen.uc +++ b/ServerExt/Classes/Ext_TGroupRegen.uc @@ -15,15 +15,15 @@ static function bool GroupLimited(Ext_PerkBase Perk, class Trait) local byte n; n = GetMaxLimit(Perk); - for(i=0; i0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class && --n==0) + for (i=0; i0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class && --n==0) return true; return false; } static final function byte GetMaxLimit(Ext_PerkBase Perk) { - if(Perk.CurrentPrestige<1 || Perk.CurrentLevel<100) + if (Perk.CurrentPrestige<1 || Perk.CurrentLevel<100) return 1; return ((Perk.CurrentPrestige<5 || Perk.CurrentLevel<150) ? 2 : 3); } diff --git a/ServerExt/Classes/Ext_T_AmmoRegHelp.uc b/ServerExt/Classes/Ext_T_AmmoRegHelp.uc index 46fba8a..792cb2f 100644 --- a/ServerExt/Classes/Ext_T_AmmoRegHelp.uc +++ b/ServerExt/Classes/Ext_T_AmmoRegHelp.uc @@ -7,7 +7,7 @@ var float RegCount; function PostBeginPlay() { PawnOwner = Pawn(Owner); - if(PawnOwner==None) + if (PawnOwner==None) Destroy(); else SetTimer(29+FRand(),true); } @@ -17,15 +17,15 @@ function Timer() local byte i; local int ExtraAmmo; - if(PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None) + if (PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None) Destroy(); else { foreach PawnOwner.InvManager.InventoryActors(class'KFWeapon',W) { - for(i=0; i<2; ++i) + for (i=0; i<2; ++i) { - if(W.SpareAmmoCount[i] < W.SpareAmmoCapacity[i]) + if (W.SpareAmmoCount[i] < W.SpareAmmoCapacity[i]) { ExtraAmmo = FMax(float(W.SpareAmmoCapacity[i] + W.MagazineCapacity[i])*RegCount,1.f); if (i==0) diff --git a/ServerExt/Classes/Ext_T_ArmorRegHelp.uc b/ServerExt/Classes/Ext_T_ArmorRegHelp.uc index 2d06f9f..b870b9c 100644 --- a/ServerExt/Classes/Ext_T_ArmorRegHelp.uc +++ b/ServerExt/Classes/Ext_T_ArmorRegHelp.uc @@ -3,9 +3,9 @@ Class Ext_T_ArmorRegHelp extends Ext_T_HealthRegHelp function Timer() { - if(PawnOwner==None || PawnOwner.Health<=0) + if (PawnOwner==None || PawnOwner.Health<=0) Destroy(); - else if(PawnOwner.ArmorWorldInfo.TimeSeconds) + if (Level==1 || LastDiedTimer>WorldInfo.TimeSeconds) return false; } - else if(Level==1 && Rand(2)==0) + else if (Level==1 && Rand(2)==0) return false; LastDied = Other; bTeleporting = true; - if(SpawnPointer==None) + if (SpawnPointer==None) SpawnPointer = class'ExtSpawnPointHelper'.Static.FindHelper(WorldInfo); ResPoint = SpawnPointer.PickBestSpawn().Location; LastDied.FindSpot(vect(36,36,86),ResPoint); - if(VSizeSq(LastDied.Location-ResPoint)<1.f) // Prevent division by zero errors in future. + if (VSizeSq(LastDied.Location-ResPoint)<1.f) // Prevent division by zero errors in future. ResPoint.Z+=5; Enable('Tick'); StartResurrect(); @@ -42,10 +42,10 @@ final function StartResurrect() LastDied.Health = 9999; LastDied.LastStartTime = WorldInfo.TimeSeconds; - if(ExtHumanPawn(LastDied)!=None) + if (ExtHumanPawn(LastDied)!=None) { ExtHumanPawn(LastDied).bCanBecomeRagdoll = false; - if(!ExtHumanPawn(LastDied).CanBeRedeemed()) + if (!ExtHumanPawn(LastDied).CanBeRedeemed()) { bIsDelayed = true; return; @@ -63,24 +63,24 @@ final function StartResurrect() function Tick(float Delta) { - if(!bTeleporting) + if (!bTeleporting) { Disable('Tick'); return; } - if(LastDied==None || LastDied.Health<=0) + if (LastDied==None || LastDied.Health<=0) { bTeleporting = false; return; } - if(bIsDelayed) + if (bIsDelayed) { bIsDelayed = false; StartResurrect(); return; } Delta = (LastDiedTimer-WorldInfo.TimeSeconds); - if(Delta<=0) + if (Delta<=0) { EndGhostTeleport(); return; @@ -88,7 +88,7 @@ function Tick(float Delta) Delta /= TeleTime; LastDied.Velocity = Normal(ResPoint-TeleStartPoint)*900.f; LastDied.SetLocation(TeleStartPoint*Delta+ResPoint*(1.f-Delta)); - if(LastDied.Physics!=PHYS_None) + if (LastDied.Physics!=PHYS_None) LastDied.SetPhysics(PHYS_None); } @@ -106,16 +106,16 @@ final function EndGhostTeleport() LastDied.SetPhysics(PHYS_Falling); LastDied.Velocity = vect(0,0,0); LastDied.LastStartTime = WorldInfo.TimeSeconds; // For spawn protection, if any. - if(LastDied.IsDoingSpecialMove()) // Stop any grabbing zeds. + if (LastDied.IsDoingSpecialMove()) // Stop any grabbing zeds. LastDied.EndSpecialMove(); - if(ExtHumanPawn(LastDied)!=None) + if (ExtHumanPawn(LastDied)!=None) ExtHumanPawn(LastDied).bCanBecomeRagdoll = true; } function Destroyed() { - if(bTeleporting && LastDied!=None && LastDied.Health>0) + if (bTeleporting && LastDied!=None && LastDied.Health>0) EndGhostTeleport(); } diff --git a/ServerExt/Classes/Ext_T_HealthRegHelp.uc b/ServerExt/Classes/Ext_T_HealthRegHelp.uc index c924b45..d0f7fa6 100644 --- a/ServerExt/Classes/Ext_T_HealthRegHelp.uc +++ b/ServerExt/Classes/Ext_T_HealthRegHelp.uc @@ -7,15 +7,15 @@ var byte RegCount; function PostBeginPlay() { PawnOwner = KFPawn_Human(Owner); - if(PawnOwner==None) + if (PawnOwner==None) Destroy(); else SetTimer(9+FRand(),true); } function Timer() { - if(PawnOwner==None || PawnOwner.Health<=0) + if (PawnOwner==None || PawnOwner.Health<=0) Destroy(); - else if(PawnOwner.Health=0 && ActiveUsers[i].NextUseTime>WorldInfo.TimeSeconds) + if (i>=0 && ActiveUsers[i].NextUseTime>WorldInfo.TimeSeconds) return false; - if(bInteractIfTrue) + if (bInteractIfTrue) { - if(i==-1) + if (i==-1) { i = ActiveUsers.Length; ActiveUsers.Length = i+1; @@ -113,7 +113,7 @@ simulated function bool GetCanInteract(Pawn User, optional bool bInteractIfTrue } } - if(bInteractIfTrue && WorldInfo.NetMode!=NM_Client) + if (bInteractIfTrue && WorldInfo.NetMode!=NM_Client) { GiveAmmunition(KFPawn_Human(User)); } @@ -123,43 +123,43 @@ function CleanupUsers() { local int i; - for(i=(ActiveUsers.Length-1); i>=0; --i) - if(ActiveUsers[i].Player==None || ActiveUsers[i].Player.Health<=0 || ActiveUsers[i].NextUseTime=0; --i) + if (ActiveUsers[i].Player==None || ActiveUsers[i].Player.Health<=0 || ActiveUsers[i].NextUseTime1) + if (RespawnHelperTime>1) --RespawnHelperTime; - if(OldKillsValue==PawnOwner.PlayerReplicationInfo.Kills) + if (OldKillsValue==PawnOwner.PlayerReplicationInfo.Kills) return; bNeedsKillZed = false; } - else if(RespawnHelperTime>0) + else if (RespawnHelperTime>0) { - if(--RespawnHelperTime==0) + if (--RespawnHelperTime==0) SpawnHelper(); } - else if(LiveHelper==None || LiveHelper.Health<=0) + else if (LiveHelper==None || LiveHelper.Health<=0) { OldKillsValue = PawnOwner.PlayerReplicationInfo.Kills; bNeedsKillZed = true; RespawnHelperTime = 60; } - else if(!HasLiveZeds()) + else if (!HasLiveZeds()) { - if(NoLiveCounter==0) + if (NoLiveCounter==0) { PrevMonster = LiveHelper.Class; PrevMonsterHP = (float(LiveHelper.Health) / LiveHelper.HealthMax); @@ -66,18 +66,18 @@ function Timer() } function Destroyed() { - if(LiveHelper!=None && LiveHelper.Health>0) + if (LiveHelper!=None && LiveHelper.Health>0) LiveHelper.Died(None,class'DmgType_Suicided',vect(0,0,0)); } final function bool HasLiveZeds() { local KFPawn_Monster M; - if(KFGameReplicationInfo(WorldInfo.GRI).WaveNum>=KFGameReplicationInfo(WorldInfo.GRI).WaveMax) // No pets on possible bonus waves. + if (KFGameReplicationInfo(WorldInfo.GRI).WaveNum>=KFGameReplicationInfo(WorldInfo.GRI).WaveMax) // No pets on possible bonus waves. return false; foreach WorldInfo.AllPawns(Class'KFPawn_Monster',M) - if(M.Health>0 && M.GetTeamNum()!=0) + if (M.Health>0 && M.GetTeamNum()!=0) return true; return false; } @@ -92,41 +92,41 @@ final function SpawnHelper() local AkBaseSoundObject TempSound; local bool bFinalWave; - if(PawnOwner.PlayerReplicationInfo==None || !HasLiveZeds()) + if (PawnOwner.PlayerReplicationInfo==None || !HasLiveZeds()) { RespawnHelperTime = 3; return; } NoLiveCounter = 5; bFinalWave = KFGameReplicationInfo(WorldInfo.GRI).IsFinalWave(); - if(bFinalWave && Class(PrevMonster)!=None) + if (bFinalWave && Class(PrevMonster)!=None) PrevMonster = None; MC = (PrevMonster!=None ? PrevMonster : PickRandomMonster(CurLevel,bFinalWave)); - if(MC!=None) + if (MC!=None) { R.Yaw = Rand(65536); - if(MC.Default.SoundGroupArch!=None) + if (MC.Default.SoundGroupArch!=None) { // Make no entrance roam (for FP's and Scrakes). TempSound = MC.Default.SoundGroupArch.EntranceSound; MC.Default.SoundGroupArch.EntranceSound = None; } - for(i=0; i<40; ++i) + for (i=0; i<40; ++i) { V = PawnOwner.Location; V.X += (FRand()*300.f-150.f); V.Y += (FRand()*300.f-150.f); - if(!PawnOwner.FastTrace(V,PawnOwner.Location)) + if (!PawnOwner.FastTrace(V,PawnOwner.Location)) continue; LiveHelper = Spawn(MC,,,V,R); - if(LiveHelper!=None) + if (LiveHelper!=None) break; } - if(MC.Default.SoundGroupArch!=None) + if (MC.Default.SoundGroupArch!=None) MC.Default.SoundGroupArch.EntranceSound = TempSound; } - if(LiveHelper==None) + if (LiveHelper==None) RespawnHelperTime = 2; else { @@ -136,7 +136,7 @@ final function SpawnHelper() // Setup AI C = Spawn(LiveHelper.ControllerClass); - if(KFAIController(C)!=None) + if (KFAIController(C)!=None) { KFAIController(C).bCanTeleportCloser = false; KFAIController(C).DefaultCommandClass = class'Ext_AICommandBasePet'; @@ -155,14 +155,14 @@ final function SpawnHelper() LiveHelper.bCanGrabAttack = false; // Scale by previous zed HP. - if(PrevMonster!=None) + if (PrevMonster!=None) { LiveHelper.Health *= PrevMonsterHP; PrevMonster = None; } // Setup PRI. - if(C.PlayerReplicationInfo!=None) + if (C.PlayerReplicationInfo!=None) C.PlayerReplicationInfo.Destroy(); PRI = Spawn(class'Ext_T_MonsterPRI',LiveHelper); LiveHelper.PlayerReplicationInfo = PRI; @@ -174,10 +174,10 @@ final function SpawnHelper() PRI.MonsterType = MC; PRI.PlayerName = PawnOwner.PlayerReplicationInfo.PlayerName$"'s "$PRI.MonsterName; PRI.OwnerController = PawnOwner.Controller; - if(PawnOwner.PlayerReplicationInfo.Team!=None) + if (PawnOwner.PlayerReplicationInfo.Team!=None) PawnOwner.PlayerReplicationInfo.Team.AddToTeam(C); PRI.Timer(); - if(WorldInfo.NetMode!=NM_DedicatedServer) + if (WorldInfo.NetMode!=NM_DedicatedServer) PRI.NotifyOwner(); } } @@ -185,7 +185,7 @@ final function SpawnHelper() final function SetDamageScale(float Sc) { DamageScale = Default.DamageScale*Sc; - if(LiveHelper!=None) + if (LiveHelper!=None) LiveHelper.DamageScaling = DamageScale; } final function SetHealthScale(float Sc) @@ -201,19 +201,19 @@ static final function LoadMonsterList() Default.ZedTypes.Length = class'Ext_TraitZED_Summon'.Default.ZedTypes.Length; - for(i=0; i(DynamicLoadObject(SA[j],Class'Class')); - if(C==None) + if (C==None) continue; Default.ZedTypes[i].Zeds[Default.ZedTypes[i].Zeds.Length] = C; } - if(Default.ZedTypes[i].Zeds.Length==0) + if (Default.ZedTypes[i].Zeds.Length==0) Default.ZedTypes[i].Zeds[Default.ZedTypes[i].Zeds.Length] = Class'KFPawn_ZedClot_Alpha'; } } @@ -223,13 +223,13 @@ static final function class PickRandomMonster(byte Level, bool b local class Res; Level = Min(Default.ZedTypes.Length-1,Level); - for(i=0; i<5; ++i) + for (i=0; i<5; ++i) { Res = Default.ZedTypes[Level].Zeds[Rand(Default.ZedTypes[Level].Zeds.Length)]; - if(!bNotBoss || class(Res)==None) + if (!bNotBoss || class(Res)==None) break; } - if(bNotBoss && class(Res)!=None) + if (bNotBoss && class(Res)!=None) Res = Class'KFPawn_ZedFleshpound'; return Res; } diff --git a/ServerExt/Classes/Ext_TraitAirborneAgent.uc b/ServerExt/Classes/Ext_TraitAirborneAgent.uc index c5bfca2..7de0fb9 100644 --- a/ServerExt/Classes/Ext_TraitAirborneAgent.uc +++ b/ServerExt/Classes/Ext_TraitAirborneAgent.uc @@ -13,14 +13,14 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { local int i; - if(Perk.CurrentLevel0) + if (Default.MinLevel>0) S = "Min perk level: #{FF4000}"$Default.MinLevel$"#{DEF}|"$S; return Default.Description$"||"$S; } @@ -72,9 +72,9 @@ static function string GetTooltipInfo() // Return level specific trait prices. static function int GetTraitCost(byte LevelNum) { - if(Default.LevelCosts.Length>0) + if (Default.LevelCosts.Length>0) { - if(LevelNum=0) + if (i>=0) return (Perk.PerkStats[i].CurrentValue>=30); } @@ -31,7 +31,7 @@ static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitD local ExtPlayerReplicationInfo MyPRI; MyPRI = ExtPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo); - if(MyPRI == None || Ext_PerkDemolition(Perk) == None) + if (MyPRI == None || Ext_PerkDemolition(Perk) == None) return; MyPRI.bNukeActive = true; @@ -43,7 +43,7 @@ static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_Trai local ExtPlayerReplicationInfo MyPRI; MyPRI = ExtPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo); - if(MyPRI == None || Ext_PerkDemolition(Perk) == None) + if (MyPRI == None || Ext_PerkDemolition(Perk) == None) return; MyPRI.bNukeActive = false; diff --git a/ServerExt/Classes/Ext_TraitDemoProfessional.uc b/ServerExt/Classes/Ext_TraitDemoProfessional.uc index 6f363a2..ff964d6 100644 --- a/ServerExt/Classes/Ext_TraitDemoProfessional.uc +++ b/ServerExt/Classes/Ext_TraitDemoProfessional.uc @@ -13,13 +13,13 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { local int i; - if(Perk.CurrentLevel=0) + if (i>=0) return (Perk.PerkStats[i].CurrentValue>=30); } diff --git a/ServerExt/Classes/Ext_TraitDuracell.uc b/ServerExt/Classes/Ext_TraitDuracell.uc index e498f4f..70fd17f 100644 --- a/ServerExt/Classes/Ext_TraitDuracell.uc +++ b/ServerExt/Classes/Ext_TraitDuracell.uc @@ -4,12 +4,12 @@ var array BatteryCharges; static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if(ExtHumanPawn(Player)!=None) + if (ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).SetBatteryRate(Default.BatteryCharges[Level-1]); } static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if(ExtHumanPawn(Player)!=None) + if (ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).SetBatteryRate(1.f); } diff --git a/ServerExt/Classes/Ext_TraitGhost.uc b/ServerExt/Classes/Ext_TraitGhost.uc index e8ff092..40f9811 100644 --- a/ServerExt/Classes/Ext_TraitGhost.uc +++ b/ServerExt/Classes/Ext_TraitGhost.uc @@ -4,13 +4,13 @@ static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Cl { local Controller C; - if((Instigator==None || Instigator==Player.Controller) && DamType==Class'DmgType_Suicided') + if ((Instigator==None || Instigator==Player.Controller) && DamType==Class'DmgType_Suicided') return false; // Allow normal suicide to go ahead. - if(Ext_T_GhostHelper(Data).CanResPlayer(Player,Level)) + if (Ext_T_GhostHelper(Data).CanResPlayer(Player,Level)) { // Abort current special move - if(Player.IsDoingSpecialMove()) + if (Player.IsDoingSpecialMove()) Player.SpecialMoveHandler.EndSpecialMove(); // Notify AI to stop hunting me. diff --git a/ServerExt/Classes/Ext_TraitGrenadeSUpg.uc b/ServerExt/Classes/Ext_TraitGrenadeSUpg.uc index 40cd183..83dc6a2 100644 --- a/ServerExt/Classes/Ext_TraitGrenadeSUpg.uc +++ b/ServerExt/Classes/Ext_TraitGrenadeSUpg.uc @@ -2,7 +2,7 @@ Class Ext_TraitGrenadeSUpg extends Ext_TraitBase; static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if(Level==1) + if (Level==1) Perk.GrenadeClass = Perk.SuperGrenade; } static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) diff --git a/ServerExt/Classes/Ext_TraitGrenadeUpg.uc b/ServerExt/Classes/Ext_TraitGrenadeUpg.uc index 8e2d84d..34a4a0f 100644 --- a/ServerExt/Classes/Ext_TraitGrenadeUpg.uc +++ b/ServerExt/Classes/Ext_TraitGrenadeUpg.uc @@ -2,15 +2,15 @@ Class Ext_TraitGrenadeUpg extends Ext_TraitBase; static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { - if(Lvl>=1 && Perk.CurrentLevel<50) + if (Lvl>=1 && Perk.CurrentLevel<50) return false; return Super.MeetsRequirements(Lvl,Perk); } static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if(Level==1) + if (Level==1) Perk.GrenadeClass = Perk.PerkGrenade; - else if(Level==2) + else if (Level==2) Perk.GrenadeClass = Perk.SuperGrenade; } static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) diff --git a/ServerExt/Classes/Ext_TraitHealthReg.uc b/ServerExt/Classes/Ext_TraitHealthReg.uc index f8b669e..40e346b 100644 --- a/ServerExt/Classes/Ext_TraitHealthReg.uc +++ b/ServerExt/Classes/Ext_TraitHealthReg.uc @@ -7,7 +7,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level local Ext_T_HealthRegHelp H; H = Player.Spawn(class'Ext_T_HealthRegHelp',Player); - if(H!=None) + if (H!=None) H.RegCount = Default.RegenValues[Level-1]; } static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) diff --git a/ServerExt/Classes/Ext_TraitHeavyArmor.uc b/ServerExt/Classes/Ext_TraitHeavyArmor.uc index b341da6..3074cd4 100644 --- a/ServerExt/Classes/Ext_TraitHeavyArmor.uc +++ b/ServerExt/Classes/Ext_TraitHeavyArmor.uc @@ -11,7 +11,7 @@ static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_Trai static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if(Level <= 1) + if (Level <= 1) return; Level == 2 ? Player.AddArmor(50) : Player.AddArmor(Player.MaxArmor); diff --git a/ServerExt/Classes/Ext_TraitKnockback.uc b/ServerExt/Classes/Ext_TraitKnockback.uc index a2c286c..b7fd800 100644 --- a/ServerExt/Classes/Ext_TraitKnockback.uc +++ b/ServerExt/Classes/Ext_TraitKnockback.uc @@ -2,12 +2,12 @@ Class Ext_TraitKnockback extends Ext_TraitRagdoll; static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if(ExtHumanPawn(Player)!=None) + if (ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).KnockbackResist = Default.ChanceValues[Level-1]; } static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if(ExtHumanPawn(Player)!=None) + if (ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).KnockbackResist = 1.f; } diff --git a/ServerExt/Classes/Ext_TraitMachineGunner.uc b/ServerExt/Classes/Ext_TraitMachineGunner.uc index 5b275ac..3babbb8 100644 --- a/ServerExt/Classes/Ext_TraitMachineGunner.uc +++ b/ServerExt/Classes/Ext_TraitMachineGunner.uc @@ -11,7 +11,7 @@ static function string GetPerkDescription() static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { - if(Perk.CurrentLevel AtkRates; static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if(ExtHumanPawn(Player)!=None) + if (ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).bMovesFastInZedTime = true; Ext_PerkBerserker(Perk).ZedTimeMeleeAtkRate = 1.f/Default.AtkRates[Level-1]; } static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if(ExtHumanPawn(Player)!=None) + if (ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).bMovesFastInZedTime = false; Ext_PerkBerserker(Perk).ZedTimeMeleeAtkRate = 1.f; } diff --git a/ServerExt/Classes/Ext_TraitSupplyData.uc b/ServerExt/Classes/Ext_TraitSupplyData.uc index 01053fa..4254170 100644 --- a/ServerExt/Classes/Ext_TraitSupplyData.uc +++ b/ServerExt/Classes/Ext_TraitSupplyData.uc @@ -4,7 +4,7 @@ var Ext_T_SupplierInteract SupplyInteraction; final function SpawnSupplier(KFPawn_Human H, optional bool bGrenades) { - if(SupplyInteraction!=None) + if (SupplyInteraction!=None) SupplyInteraction.Destroy(); SupplyInteraction = Spawn(class'Ext_T_SupplierInteract', H,, H.Location, H.Rotation,, true); @@ -13,15 +13,15 @@ final function SpawnSupplier(KFPawn_Human H, optional bool bGrenades) SupplyInteraction.PerkOwner = Perk; SupplyInteraction.bGrenades = bGrenades; - if(PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None) + if (PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None) ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = class(TraitClass); } final function RemoveSupplier() { - if(SupplyInteraction!=None) + if (SupplyInteraction!=None) SupplyInteraction.Destroy(); - if(PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None) + if (PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None) ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = None; } function Destroyed() diff --git a/ServerExt/Classes/Ext_TraitTactician.uc b/ServerExt/Classes/Ext_TraitTactician.uc index 3d5b5cc..e50d763 100644 --- a/ServerExt/Classes/Ext_TraitTactician.uc +++ b/ServerExt/Classes/Ext_TraitTactician.uc @@ -13,13 +13,13 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { local int i; - if(Perk.CurrentLevel=0) + if (i>=0) return (Perk.PerkStats[i].CurrentValue>=30); } diff --git a/ServerExt/Classes/Ext_TraitUnCloak.uc b/ServerExt/Classes/Ext_TraitUnCloak.uc index 65cc7b9..10954a7 100644 --- a/ServerExt/Classes/Ext_TraitUnCloak.uc +++ b/ServerExt/Classes/Ext_TraitUnCloak.uc @@ -7,7 +7,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level local Ext_T_UnCloakHelper H; H = Player.Spawn(class'Ext_T_UnCloakHelper',Player); - if(H!=None) + if (H!=None) H.HandleRadius = Default.RadiusValues[Level-1]; } static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) diff --git a/ServerExt/Classes/Ext_TraitWeapons.uc b/ServerExt/Classes/Ext_TraitWeapons.uc index 2d7aae8..6309ac4 100644 --- a/ServerExt/Classes/Ext_TraitWeapons.uc +++ b/ServerExt/Classes/Ext_TraitWeapons.uc @@ -9,7 +9,7 @@ var array LevelEffects; static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { - if(Lvl>=3 && (Perk.CurrentLevel<50 || !HasMaxCarry(Perk))) + if (Lvl>=3 && (Perk.CurrentLevel<50 || !HasMaxCarry(Perk))) return false; return Super.MeetsRequirements(Lvl,Perk); } @@ -42,18 +42,18 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level Level = Min(Level-1,Default.LevelEffects.Length-1); M = KFInventoryManager(Player.InvManager); - if(M!=None) + if (M!=None) M.bInfiniteWeight = true; foreach Default.LevelEffects[Level].LoadoutClasses(IC) { - if(Player.FindInventoryType(IC)==None) + if (Player.FindInventoryType(IC)==None) { Inv = Player.CreateInventory(IC,Player.Weapon!=None); if (KFWeapon(Inv)!=None) KFWeapon(Inv).bGivenAtStart = true; } } - if(M!=None) + if (M!=None) M.bInfiniteWeight = false; } static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) @@ -61,13 +61,13 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve local class IC; local Inventory Inv; - if(Level==0) + if (Level==0) return; Level = Min(Level-1,Default.LevelEffects.Length-1); foreach Default.LevelEffects[Level].LoadoutClasses(IC) { Inv = Player.FindInventoryType(IC); - if(Inv!=None) + if (Inv!=None) Inv.Destroy(); } } diff --git a/ServerExt/Classes/Ext_TraitZEDBase.uc b/ServerExt/Classes/Ext_TraitZEDBase.uc index ac66cb2..ba51df8 100644 --- a/ServerExt/Classes/Ext_TraitZEDBase.uc +++ b/ServerExt/Classes/Ext_TraitZEDBase.uc @@ -9,14 +9,14 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) local int i; // First check level. - if(Perk.CurrentLevel=0) + if (i>=0) return (Perk.PerkTraits[i].CurrentLevel>0); } return true; diff --git a/ServerExt/Classes/Ext_TraitZED_Summon.uc b/ServerExt/Classes/Ext_TraitZED_Summon.uc index c48c9a6..7c1b0ce 100644 --- a/ServerExt/Classes/Ext_TraitZED_Summon.uc +++ b/ServerExt/Classes/Ext_TraitZED_Summon.uc @@ -15,7 +15,7 @@ static function string GetPerkDescription() local string S; S = Super.GetPerkDescription(); - if(Default.FinalLevelPrestige>0) + if (Default.FinalLevelPrestige>0) S $= "|Level 6 requires prestige level: #{FF4000}"$Default.FinalLevelPrestige; return S; } @@ -24,14 +24,14 @@ static function CheckConfig() { local byte i,j; - if(Default.ZedTypes.Length==0) + if (Default.ZedTypes.Length==0) { Default.ZedTypes.Length = Default.DefZedTypes.Length; - for(i=0; i=5 && Perk.CurrentPrestige=5 && Perk.CurrentPrestige=0) + if (i>=0) return (Perk.PerkStats[i].CurrentValue>=30); } return true; @@ -89,12 +89,12 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level local int i; H = Player.Spawn(class'Ext_T_ZEDHelper',Player); - if(H!=None) + if (H!=None) H.CurLevel = Level-1; // Make other traits refresh (apply HP/damage scalers). - for(i=0; i0 && Class(Perk.PerkTraits[i].TraitType)!=None && !Class(Perk.PerkTraits[i].TraitType).Default.bIsSummoner) + for (i=0; i0 && Class(Perk.PerkTraits[i].TraitType)!=None && !Class(Perk.PerkTraits[i].TraitType).Default.bIsSummoner) Perk.PerkTraits[i].TraitType.Static.ApplyEffectOn(Player,Perk,Level,Data); } static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) @@ -102,7 +102,7 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve local Ext_T_ZEDHelper H; foreach Player.ChildActors(class'Ext_T_ZEDHelper',H) - if(!H.bIsExtra) + if (!H.bIsExtra) H.Destroy(); } @@ -124,7 +124,7 @@ static function string ClientSetRepData(string S) static function string GetValue(name PropName, int ElementIndex) { - switch(PropName) + switch (PropName) { case 'ZedTypes': return (ElementIndex==-1 ? string(Default.ZedTypes.Length) : Default.ZedTypes[ElementIndex]); @@ -138,10 +138,10 @@ static function string GetValue(name PropName, int ElementIndex) } static function ApplyValue(name PropName, int ElementIndex, string Value) { - switch(PropName) + switch (PropName) { case 'ZedTypes': - if(Value!="#DELETE" && ElementIndex0 && Class(Perk.PerkTraits[i].TraitType)!=None && !Class(Perk.PerkTraits[i].TraitType).Default.bIsSummoner) + for (i=0; i0 && Class(Perk.PerkTraits[i].TraitType)!=None && !Class(Perk.PerkTraits[i].TraitType).Default.bIsSummoner) Perk.PerkTraits[i].TraitType.Static.ApplyEffectOn(Player,Perk,Level,Data); } static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) @@ -38,7 +38,7 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve local Ext_T_ZEDHelper H; foreach Player.ChildActors(class'Ext_T_ZEDHelper',H) - if(H.bIsExtra) + if (H.bIsExtra) H.Destroy(); } static final function AddHelperType(byte Lv, KFPawn_Human Player) @@ -46,7 +46,7 @@ static final function AddHelperType(byte Lv, KFPawn_Human Player) local Ext_T_ZEDHelper H; H = Player.Spawn(class'Ext_T_ZEDHelper',Player); - if(H!=None) + if (H!=None) { H.CurLevel = Lv; H.bIsExtra = true; diff --git a/ServerExt/Classes/Ext_TraitZedative.uc b/ServerExt/Classes/Ext_TraitZedative.uc index 0e56cc4..e7c7daa 100644 --- a/ServerExt/Classes/Ext_TraitZedative.uc +++ b/ServerExt/Classes/Ext_TraitZedative.uc @@ -13,13 +13,13 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { local int i; - if(Perk.CurrentLevel=0) + if (i>=0) return (Perk.PerkStats[i].CurrentValue>=25); } diff --git a/ServerExt/Classes/GUIStyleBase.uc b/ServerExt/Classes/GUIStyleBase.uc index e48c831..146bdd5 100644 --- a/ServerExt/Classes/GUIStyleBase.uc +++ b/ServerExt/Classes/GUIStyleBase.uc @@ -10,7 +10,7 @@ var transient Canvas Canvas; function InitStyle() { ItemTex = Texture2D(DynamicLoadObject("UI_LevelChevrons_TEX.UI_LevelChevron_Icon_02",class'Texture2D')); - if(ItemTex==None) + if (ItemTex==None) ItemTex = Texture2D'EngineMaterials.DefaultWhiteGrid'; } function RenderFramedWindow(KFGUI_FloatingWindow P); @@ -32,13 +32,13 @@ function PickDefaultFontSize(float YRes) local string S; DefaultFontSize = 0; - if(YRes>800) + if (YRes>800) ++DefaultFontSize; - if(YRes>1000) + if (YRes>1000) ++DefaultFontSize; - //if(YRes>1200) + //if (YRes>1200) //++DefaultFontSize; - //if(YRes>1300) + //if (YRes>1300) //++DefaultFontSize; S = "ABC"; @@ -55,7 +55,7 @@ final function DrawText(byte Res, string S) final function DrawCornerTexNU(int SizeX, int SizeY, byte Dir) // Draw non-uniform corner. { - switch(Dir) + switch (Dir) { case 0: // Up-left Canvas.DrawTile(ItemTex,SizeX,SizeY,77,15,-66,58); @@ -72,7 +72,7 @@ final function DrawCornerTexNU(int SizeX, int SizeY, byte Dir) // Draw non-unifo } final function DrawCornerTex(int Size, byte Dir) { - switch(Dir) + switch (Dir) { case 0: // Up-left Canvas.DrawTile(ItemTex,Size,Size,77,15,-66,58); @@ -94,7 +94,7 @@ final function DrawWhiteBox(int XS, int YS) final function DrawRectBox(int X, int Y, int XS, int YS, int Edge, optional byte Extrav) { - if(Extrav==2) + if (Extrav==2) Edge = Min(FMin(Edge,(XS)*0.5),YS);// Verify size. else Edge = Min(FMin(Edge,(XS)*0.5),(YS)*0.5);// Verify size. @@ -102,9 +102,9 @@ final function DrawRectBox(int X, int Y, int XS, int YS, int Edge, optional byte Canvas.SetPos(X,Y); DrawCornerTex(Edge,0); - if(Extrav<=1) + if (Extrav<=1) { - if(Extrav==0) + if (Extrav==0) { // Top right Canvas.SetPos(X+XS-Edge,Y); @@ -122,7 +122,7 @@ final function DrawRectBox(int X, int Y, int XS, int YS, int Edge, optional byte Canvas.SetPos(X+XS-Edge,Y+Edge); DrawWhiteBox(Edge,YS-Edge*2); } - else if(Extrav==1) + else if (Extrav==1) { // Top right Canvas.SetPos(X+XS,Y); diff --git a/ServerExt/Classes/KF2GUIController.uc b/ServerExt/Classes/KF2GUIController.uc index f660e67..293f406 100644 --- a/ServerExt/Classes/KF2GUIController.uc +++ b/ServerExt/Classes/KF2GUIController.uc @@ -23,12 +23,12 @@ static function KF2GUIController GetGUIController(PlayerController PC) { local KF2GUIController G; - if(PC.Player==None) + if (PC.Player==None) return None; foreach PC.ChildActors(class'KF2GUIController',G) - if(!G.bIsInvalid) + if (!G.bIsInvalid) break; - if(G==None) + if (G==None) G = PC.Spawn(class'KF2GUIController',PC); return G; } @@ -43,25 +43,25 @@ simulated function PostBeginPlay() simulated function Destroyed() { - if(PlayerOwner!=None) + if (PlayerOwner!=None) SetMenuState(false); } simulated function HandleDrawMenu() { - if(HackConsole==None) + if (HackConsole==None) { HackConsole = new(ClientViewport)class'KFGUIConsoleHack'; HackConsole.OutputObject = Self; } - if(HackConsole!=ClientViewport.ViewportConsole) + if (HackConsole!=ClientViewport.ViewportConsole) { OrgConsole = ClientViewport.ViewportConsole; ClientViewport.ViewportConsole = HackConsole; // Make sure nothing overrides these settings while menu is being open. PlayerOwner.PlayerInput = CustomInput; - if(!ClientViewport.bDisplayHardwareMouseCursor) + if (!ClientViewport.bDisplayHardwareMouseCursor) { ClientViewport.bDisplayHardwareMouseCursor = true; ClientViewport.ForceUpdateMouseCursor(TRUE); @@ -89,7 +89,7 @@ simulated function RenderMenu(Canvas C) ClipX = C.ClipX; ClipY = C.ClipY; - for(i=(ActiveMenus.Length-1); i>=0; --i) + for (i=(ActiveMenus.Length-1); i>=0; --i) { ActiveMenus[i].bWindowFocused = (i==0); ActiveMenus[i].InputPos[0] = 0.f; @@ -99,7 +99,7 @@ simulated function RenderMenu(Canvas C) ActiveMenus[i].Canvas = C; ActiveMenus[i].PreDraw(); } - if(InputFocus!=None && InputFocus.bFocusedPostDrawItem) + if (InputFocus!=None && InputFocus.bFocusedPostDrawItem) { InputFocus.InputPos[0] = 0.f; InputFocus.InputPos[1] = 0.f; @@ -111,26 +111,26 @@ simulated function RenderMenu(Canvas C) C.SetOrigin(OrgX,OrgY); C.SetClip(ClipX,ClipY); - if(OrgConsole!=None) + if (OrgConsole!=None) OrgConsole.PostRender_Console(C); OrgConsole = None; } simulated final function SetMenuState(bool bActive) { - if(PlayerOwner.PlayerInput==None) + if (PlayerOwner.PlayerInput==None) { NotifyLevelChange(); bActive = false; } - if(bIsInMenuState==bActive) + if (bIsInMenuState==bActive) return; bIsInMenuState = bActive; - if(bActive) + if (bActive) { - if(CustomInput==None) + if (CustomInput==None) { CustomInput = new (KFPlayerController(PlayerOwner)) class'KF2GUIInput'; CustomInput.ControllerOwner = Self; @@ -146,7 +146,7 @@ simulated final function SetMenuState(bool bActive) } else { - if(BackupInput!=None) + if (BackupInput!=None) { PlayerOwner.PlayerInput = BackupInput; BackupInput.OnReceivedNativeInputKey = BackupInput.OnReceivedNativeInputKey; @@ -162,19 +162,19 @@ simulated function NotifyLevelChange() { local int i; - if(bIsInvalid) + if (bIsInvalid) return; bIsInvalid = true; - if(InputFocus!=None) + if (InputFocus!=None) { InputFocus.LostInputFocus(); InputFocus = None; } - for(i=(ActiveMenus.Length-1); i>=0; --i) + for (i=(ActiveMenus.Length-1); i>=0; --i) ActiveMenus[i].NotifyLevelChange(); - for(i=(PersistentMenus.Length-1); i>=0; --i) + for (i=(PersistentMenus.Length-1); i>=0; --i) PersistentMenus[i].NotifyLevelChange(); SetMenuState(false); @@ -184,36 +184,36 @@ simulated function MenuInput(float DeltaTime) { local int i; - if(PlayerOwner.PlayerInput==None) + if (PlayerOwner.PlayerInput==None) { NotifyLevelChange(); return; } - if(InputFocus!=None) + if (InputFocus!=None) InputFocus.MenuTick(DeltaTime); - for(i=0; i5.f || Abs(MousePosition.Y-OldMousePos.Y)>5.f || (bMouseWasIdle && MousePauseTime<0.5f)) + if (Abs(MousePosition.X-OldMousePos.X)>5.f || Abs(MousePosition.Y-OldMousePos.Y)>5.f || (bMouseWasIdle && MousePauseTime<0.5f)) { - if(bMouseWasIdle) + if (bMouseWasIdle) { bMouseWasIdle = false; - if(InputFocus!=None) + if (InputFocus!=None) InputFocus.InputMouseMoved(); } OldMousePos = MousePosition; MousePauseTime = 0.f; } - else if(!bMouseWasIdle && (MousePauseTime+=DeltaTime)>0.5f) + else if (!bMouseWasIdle && (MousePauseTime+=DeltaTime)>0.5f) { bMouseWasIdle = true; - if(MouseFocus!=None) + if (MouseFocus!=None) MouseFocus.NotifyMousePaused(); } - if(ActiveMenus.Length>0) + if (ActiveMenus.Length>0) MenuTime+=DeltaTime; } @@ -227,15 +227,15 @@ simulated function MouseMove(float MouseX, float MouseY) MousePosition.Y = Clamp(MouseY, 0, ScreenSize.Y); // Capture mouse for GUI - if(InputFocus!=None && InputFocus.bCanFocus) + if (InputFocus!=None && InputFocus.bCanFocus) { - if(InputFocus.CaptureMouse()) + if (InputFocus.CaptureMouse()) { F = InputFocus.GetMouseFocus(); - if(F!=MouseFocus) + if (F!=MouseFocus) { MousePauseTime = 0; - if(MouseFocus!=None) + if (MouseFocus!=None) MouseFocus.MouseLeave(); MouseFocus = F; F.MouseEnter(); @@ -245,32 +245,32 @@ simulated function MouseMove(float MouseX, float MouseY) } else { - for(i=0; i MenuClass) local int i; local KFGUI_Page M; - if(MenuClass==None) + if (MenuClass==None) return None; - if(KeyboardFocus!=None) + if (KeyboardFocus!=None) GrabInputFocus(None); - if(InputFocus!=None) + if (InputFocus!=None) { InputFocus.LostInputFocus(); InputFocus = None; @@ -310,12 +310,12 @@ simulated function KFGUI_Page OpenMenu(class MenuClass) SetMenuState(true); // Check if should use pre-excisting menu. - if(MenuClass.Default.bUnique) + if (MenuClass.Default.bUnique) { - for(i=0; i0 && ActiveMenus[i].BringPageToFront()) // Sort it upfront. + if (i>0 && ActiveMenus[i].BringPageToFront()) // Sort it upfront. { M = ActiveMenus[i]; ActiveMenus.Remove(i,1); @@ -325,10 +325,10 @@ simulated function KFGUI_Page OpenMenu(class MenuClass) return M; } - if(MenuClass.Default.bPersistant) + if (MenuClass.Default.bPersistant) { - for(i=0; i MenuClass) } M = New(None)MenuClass; - if(M==None) // Probably abstract class. + if (M==None) // Probably abstract class. return None; i = GetFreeIndex(M.bAlwaysTop); @@ -356,28 +356,28 @@ simulated function CloseMenu(class MenuClass, optional bool bCloseAl local int i; local KFGUI_Page M; - if(!bCloseAll && MenuClass==None) + if (!bCloseAll && MenuClass==None) return; - if(KeyboardFocus!=None) + if (KeyboardFocus!=None) GrabInputFocus(None); - if(InputFocus!=None) + if (InputFocus!=None) { InputFocus.LostInputFocus(); InputFocus = None; } - for(i=(ActiveMenus.Length-1); i>=0; --i) - if(bCloseAll || ActiveMenus[i].Class==MenuClass) + for (i=(ActiveMenus.Length-1); i>=0; --i) + if (bCloseAll || ActiveMenus[i].Class==MenuClass) { M = ActiveMenus[i]; ActiveMenus.Remove(i,1); M.CloseMenu(); // Cache menu. - if(M.bPersistant && M.bUnique) + if (M.bPersistant && M.bUnique) PersistentMenus[PersistentMenus.Length] = M; } - if(ActiveMenus.Length==0) + if (ActiveMenus.Length==0) SetMenuState(false); } simulated function PopCloseMenu(KFGUI_Base Item) @@ -385,46 +385,46 @@ simulated function PopCloseMenu(KFGUI_Base Item) local int i; local KFGUI_Page M; - if(Item==None) + if (Item==None) return; - if(KeyboardFocus!=None) + if (KeyboardFocus!=None) GrabInputFocus(None); - if(InputFocus!=None) + if (InputFocus!=None) { InputFocus.LostInputFocus(); InputFocus = None; } - for(i=(ActiveMenus.Length-1); i>=0; --i) - if(ActiveMenus[i]==Item) + for (i=(ActiveMenus.Length-1); i>=0; --i) + if (ActiveMenus[i]==Item) { M = ActiveMenus[i]; ActiveMenus.Remove(i,1); M.CloseMenu(); // Cache menu. - if(M.bPersistant && M.bUnique) + if (M.bPersistant && M.bUnique) PersistentMenus[PersistentMenus.Length] = M; break; } - if(ActiveMenus.Length==0) + if (ActiveMenus.Length==0) SetMenuState(false); } simulated function BringMenuToFront(KFGUI_Page Page) { local int i; - if(ActiveMenus[0].bAlwaysTop && !Page.bAlwaysTop) + if (ActiveMenus[0].bAlwaysTop && !Page.bAlwaysTop) return; // Can't override this menu. // Try to remove from current position at stack. - for(i=(ActiveMenus.Length-1); i>=0; --i) - if(ActiveMenus[i]==Page) + for (i=(ActiveMenus.Length-1); i>=0; --i) + if (ActiveMenus[i]==Page) { ActiveMenus.Remove(i,1); break; } - if(i==-1) + if (i==-1) return; // Page isn't open. // Put on front of stack. @@ -435,25 +435,25 @@ simulated final function bool MenuIsOpen(optional class MenuClass) { local int i; - for(i=(ActiveMenus.Length-1); i>=0; --i) - if(MenuClass==None || ActiveMenus[i].Class==MenuClass) + for (i=(ActiveMenus.Length-1); i>=0; --i) + if (MenuClass==None || ActiveMenus[i].Class==MenuClass) return true; return false; } simulated final function GrabInputFocus(KFGUI_Base Comp, optional bool bForce) { - if(Comp==KeyboardFocus && !bForce) + if (Comp==KeyboardFocus && !bForce) return; - if(KeyboardFocus!=None) + if (KeyboardFocus!=None) KeyboardFocus.LostKeyFocus(); - if(Comp==None) + if (Comp==None) { OnInputKey = InternalInputKey; OnReceivedInputChar = InternalReceivedInputChar; } - else if(KeyboardFocus==None) + else if (KeyboardFocus==None) { OnInputKey = Comp.NotifyInputKey; OnReceivedInputChar = Comp.NotifyInputChar; @@ -467,17 +467,17 @@ simulated final function GUI_InputMouse(bool bPressed, bool bRight) MousePauseTime = 0; - if(bPressed) + if (bPressed) { - if(KeyboardFocus!=None && KeyboardFocus!=MouseFocus) + if (KeyboardFocus!=None && KeyboardFocus!=MouseFocus) { GrabInputFocus(None); LastClickTimes[0] = 0; LastClickTimes[1] = 0; } - if(MouseFocus!=None) + if (MouseFocus!=None) { - if(MouseFocus!=InputFocus && !MouseFocus.bClickable && !MouseFocus.IsTopMenu() && MouseFocus.BringPageToFront()) + if (MouseFocus!=InputFocus && !MouseFocus.bClickable && !MouseFocus.IsTopMenu() && MouseFocus.BringPageToFront()) { BringMenuToFront(MouseFocus.GetPageTop()); LastClickTimes[0] = 0; @@ -486,7 +486,7 @@ simulated final function GUI_InputMouse(bool bPressed, bool bRight) else { i = byte(bRight); - if((MenuTime-LastClickTimes[i])<0.2 && Abs(LastClickPos[i].X-MousePosition.X)<5 && Abs(LastClickPos[i].Y-MousePosition.Y)<5) + if ((MenuTime-LastClickTimes[i])<0.2 && Abs(LastClickPos[i].X-MousePosition.X)<5 && Abs(LastClickPos[i].Y-MousePosition.Y)<5) { LastClickTimes[i] = 0; MouseFocus.DoubleMouseClick(bRight); @@ -499,7 +499,7 @@ simulated final function GUI_InputMouse(bool bPressed, bool bRight) } } } - else if(InputFocus!=None) + else if (InputFocus!=None) { InputFocus.LostInputFocus(); InputFocus = None; @@ -509,9 +509,9 @@ simulated final function GUI_InputMouse(bool bPressed, bool bRight) } else { - if(InputFocus!=None) + if (InputFocus!=None) InputFocus.MouseRelease(bRight); - else if(MouseFocus!=None) + else if (MouseFocus!=None) MouseFocus.MouseRelease(bRight); } } @@ -519,7 +519,7 @@ simulated final function bool CheckMouse(name Key, EInputEvent Event) { if (Event == IE_Pressed) { - switch(Key) + switch (Key) { case 'LeftMouseButton': GUI_InputMouse(true,false); @@ -531,7 +531,7 @@ simulated final function bool CheckMouse(name Key, EInputEvent Event) } else if (Event == IE_Released) { - switch(Key) + switch (Key) { case 'LeftMouseButton': GUI_InputMouse(false,false); @@ -545,19 +545,19 @@ simulated final function bool CheckMouse(name Key, EInputEvent Event) } simulated function bool ReceivedInputKey(int ControllerId, name Key, EInputEvent Event, optional float AmountDepressed=1.f, optional bool bGamepad) { - if(!bIsInMenuState) + if (!bIsInMenuState) return false; - if(!CheckMouse(Key,Event) && !OnInputKey(ControllerId,Key,Event,AmountDepressed,bGamepad)) + if (!CheckMouse(Key,Event) && !OnInputKey(ControllerId,Key,Event,AmountDepressed,bGamepad)) { - switch(Key) + switch (Key) { case 'Escape': - if(Event==IE_Pressed) + if (Event==IE_Pressed) ActiveMenus[0].UserPressedEsc(); // Pop top menu if possible. return true; case 'MouseScrollDown': case 'MouseScrollUp': - if(Event==IE_Pressed && MouseFocus!=None) + if (Event==IE_Pressed && MouseFocus!=None) MouseFocus.ScrollMouseWheel(Key=='MouseScrollUp'); return true; } @@ -567,7 +567,7 @@ simulated function bool ReceivedInputKey(int ControllerId, name Key, EInputEvent } simulated function bool ReceivedInputChar(int ControllerId, string Unicode) { - if(!bIsInMenuState) + if (!bIsInMenuState) return false; return OnReceivedInputChar(ControllerId,Unicode); } diff --git a/ServerExt/Classes/KF2GUIInput.uc b/ServerExt/Classes/KF2GUIInput.uc index f1cbe54..71d73ba 100644 --- a/ServerExt/Classes/KF2GUIInput.uc +++ b/ServerExt/Classes/KF2GUIInput.uc @@ -10,7 +10,7 @@ function DrawHUD(HUD H) } function PostRender(Canvas Canvas) { - if(ControllerOwner.bIsInMenuState) + if (ControllerOwner.bIsInMenuState) ControllerOwner.HandleDrawMenu(); //ControllerOwner.RenderMenu(Canvas); } @@ -21,7 +21,7 @@ function PlayerInput(float DeltaTime) // Do not move. ControllerOwner.MenuInput(DeltaTime); - if(!ControllerOwner.bAbsorbInput) + if (!ControllerOwner.bAbsorbInput) { aMouseX = 0; aMouseY = 0; diff --git a/ServerExt/Classes/KF2GUINetwork.uc b/ServerExt/Classes/KF2GUINetwork.uc index 16d05b2..0c4e06a 100644 --- a/ServerExt/Classes/KF2GUINetwork.uc +++ b/ServerExt/Classes/KF2GUINetwork.uc @@ -12,7 +12,7 @@ static function OpenMenuForClient(PlayerController PC, class Page) foreach PC.ChildActors(class'KF2GUINetwork',G) break; - if(G==None) + if (G==None) G = PC.Spawn(class'KF2GUINetwork',PC); G.ClientOpenMenu(Page); } @@ -22,24 +22,24 @@ static function CloseMenuForClient(PlayerController PC, class Page, foreach PC.ChildActors(class'KF2GUINetwork',G) break; - if(G==None) + if (G==None) G = PC.Spawn(class'KF2GUINetwork',PC); G.ClientCloseMenu(Page,bCloseAll); } simulated reliable client function ClientOpenMenu(class Page) { - if(!bLocalClient) + if (!bLocalClient) return; - if(GUIController==None) + if (GUIController==None) GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner); GUIController.OpenMenu(Page); } simulated reliable client function ClientCloseMenu(class Page, bool bCloseAll) { - if(!bLocalClient) + if (!bLocalClient) return; - if(GUIController==None) + if (GUIController==None) GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner); GUIController.CloseMenu(Page,bCloseAll); } @@ -47,10 +47,10 @@ simulated reliable client function ClientCloseMenu(class Page, bool simulated function PostBeginPlay() { PlayerOwner = PlayerController(Owner); - if(WorldInfo.NetMode==NM_Client || (PlayerOwner!=None && LocalPlayer(PlayerOwner.Player)!=None)) + if (WorldInfo.NetMode==NM_Client || (PlayerOwner!=None && LocalPlayer(PlayerOwner.Player)!=None)) { bLocalClient = true; - if(PlayerOwner==None) + if (PlayerOwner==None) PlayerOwner = GetALocalPlayerController(); } } diff --git a/ServerExt/Classes/KF2Style.uc b/ServerExt/Classes/KF2Style.uc index b9a094f..6d8551a 100644 --- a/ServerExt/Classes/KF2Style.uc +++ b/ServerExt/Classes/KF2Style.uc @@ -13,16 +13,16 @@ function InitStyle() LoadedTex[0] = Texture2D(DynamicLoadObject("EditorMaterials.CASC_ModuleEnable",class'Texture2D')); LoadedTex[1] = Texture2D(DynamicLoadObject("EditorMaterials.Tick",class'Texture2D')); - for(i=0; iTT.Owner.ScreenSize.X) + if ((X+TX)>TT.Owner.ScreenSize.X) X = TT.Owner.ScreenSize.X-TX; - if((Y+TY)>TT.Owner.ScreenSize.Y) + if ((Y+TY)>TT.Owner.ScreenSize.Y) Y = TT.CompPos[1]-TY; - if(TT.CurrentAlpha<255) + if (TT.CurrentAlpha<255) TT.CurrentAlpha = Min(TT.CurrentAlpha+25,255); // Reset clipping. @@ -161,7 +161,7 @@ function RenderToolTip(KFGUI_Tooltip TT) Canvas.SetDrawColor(255,255,255,TT.CurrentAlpha); X+=TOOLTIP_BORDER; Y+=TOOLTIP_BORDER; - for(i=0; i=YP && Y<=(YP+YL)) + if (bCheckMouse && Y>=YP && Y<=(YP+YL)) { bCheckMouse = false; C.CurrentRow = i; @@ -415,7 +415,7 @@ function RenderComboList(KFGUI_ComboSelector C) } Canvas.SetPos(Edge,YP); - if(i==C.Combo.SelectedIndex) + if (i==C.Combo.SelectedIndex) Canvas.DrawColor = C.Combo.SelectedTextColor; else Canvas.DrawColor = C.Combo.TextColor; @@ -424,7 +424,7 @@ function RenderComboList(KFGUI_ComboSelector C) YP+=YL; } Canvas.PopMaskRegion(); - if(C.OldRow!=C.CurrentRow) + if (C.OldRow!=C.CurrentRow) { C.OldRow = C.CurrentRow; C.PlayMenuSound(MN_DropdownChange); @@ -457,9 +457,9 @@ function RenderRightClickMenu(KFGUI_RightClickMenu C) C.CurrentRow = -1; Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX,Canvas.ClipY); - for(i=0; i=YP && Y<=(YP+DefaultHeight)) + if (bCheckMouse && Y>=YP && Y<=(YP+DefaultHeight)) { bCheckMouse = false; C.CurrentRow = i; @@ -469,14 +469,14 @@ function RenderRightClickMenu(KFGUI_RightClickMenu C) } Canvas.SetPos(Edge,YP); - if(C.ItemRows[i].bSplitter) + if (C.ItemRows[i].bSplitter) { Canvas.SetDrawColor(0,0,0,255); Canvas.DrawText("-------",,TextScale,TextScale); } else { - if(C.ItemRows[i].bDisabled) + if (C.ItemRows[i].bDisabled) Canvas.SetDrawColor(148,148,148,255); else Canvas.SetDrawColor(248,248,248,255); Canvas.DrawText(C.ItemRows[i].Text,,TextScale,TextScale); @@ -485,7 +485,7 @@ function RenderRightClickMenu(KFGUI_RightClickMenu C) YP+=DefaultHeight; } Canvas.PopMaskRegion(); - if(C.OldRow!=C.CurrentRow) + if (C.OldRow!=C.CurrentRow) { C.OldRow = C.CurrentRow; C.PlayMenuSound(MN_DropdownChange); @@ -494,7 +494,7 @@ function RenderRightClickMenu(KFGUI_RightClickMenu C) function Font PickFont(byte i, out float Scaler) { - switch(i) + switch (i) { case 0: Scaler = 0.3; diff --git a/ServerExt/Classes/KFExtendedHUD.uc b/ServerExt/Classes/KFExtendedHUD.uc index 7f98393..8b85c6d 100644 --- a/ServerExt/Classes/KFExtendedHUD.uc +++ b/ServerExt/Classes/KFExtendedHUD.uc @@ -71,7 +71,7 @@ simulated function PostBeginPlay() KFPlayerOwner = KFPlayerController(Owner); OnlineSub = class'GameEngine'.static.GetOnlineSubsystem(); - if(OnlineSub!=None) + if (OnlineSub!=None) { OnlineSub.AddOnInventoryReadCompleteDelegate(SearchInventoryForNewItem); SetTimer(60,false,'SearchInventoryForNewItem'); @@ -86,17 +86,17 @@ simulated function Destroyed() } simulated final function NotifyLevelChange(optional bool bMapswitch) { - if(OnlineSub!=None) + if (OnlineSub!=None) { OnlineSub.ClearOnInventoryReadCompleteDelegate(SearchInventoryForNewItem); OnlineSub = None; } // Send to an empty stage to play the "waiting" game. - if(bMapswitch) + if (bMapswitch) SetTimer(0.5,false,'PendingMapSwitch'); } -simulated function PendingMapSwitch() +simulated function PendingMapswitch () { // Make sure we dont garbage collect the game: class'MS_Game'.Static.SetReference(); @@ -113,8 +113,8 @@ final function AddKillMessage(class Victim, int Value, PlayerReplicationIn bDmg = (Type==2); bLcl = (Type==0); - for(i=0; i Other) local string S; local class KFM; - if(Class(Other)!=None) + if (Class(Other)!=None) return Class(Other).Default.ZombieName; KFM = class(Other); - if(KFM!=None && KFM.default.LocalizationKey != '') + if (KFM!=None && KFM.default.LocalizationKey != '') return Localize("Zeds", string(KFM.default.LocalizationKey), "KFGame"); - if(Other.Default.MenuName!="") + if (Other.Default.MenuName!="") return Other.Default.MenuName; S = string(Other.Name); - if(Left(S,10)~="KFPawn_Zed") + if (Left(S,10)~="KFPawn_Zed") S = Mid(S,10); - else if(Left(S,7)~="KFPawn_") + else if (Left(S,7)~="KFPawn_") S = Mid(S,7); S = Repl(S,"_"," "); return S; } static final function string GetNameArticle(string S) { - switch(Caps(Left(S,1))) // Check if a vowel, then an. + switch (Caps(Left(S,1))) // Check if a vowel, then an. { case "A": case "E": @@ -195,10 +195,10 @@ static final function string StripMsgColors(string S) { local int i; - while(true) + while (true) { i = InStr(S,Chr(6)); - if(i==-1) + if (i==-1) break; S = Left(S,i)$Mid(S,i+2); } @@ -208,16 +208,16 @@ final function color GetMsgColor(bool bDamage, int Count) { local float T; - if(bDamage) + if (bDamage) { - if(Count>1500) + if (Count>1500) return MakeColor(148,0,0,255); - else if(Count>1000) + else if (Count>1000) { T = (Count-1000) / 500.f; return MakeColor(148,0,0,255)*T + MakeColor(255,0,0,255)*(1.f-T); } - else if(Count>500) + else if (Count>500) { T = (Count-500) / 500.f; return MakeColor(255,0,0,255)*T + MakeColor(255,255,0,255)*(1.f-T); @@ -225,14 +225,14 @@ final function color GetMsgColor(bool bDamage, int Count) T = Count / 500.f; return MakeColor(255,255,0,255)*T + MakeColor(0,255,0,255)*(1.f-T); } - if(Count>20) + if (Count>20) return MakeColor(255,0,0,255); - else if(Count>10) + else if (Count>10) { T = (Count-10) / 10.f; return MakeColor(148,0,0,255)*T + MakeColor(255,0,0,255)*(1.f-T); } - else if(Count>5) + else if (Count>5) { T = (Count-5) / 5.f; return MakeColor(255,0,0,255)*T + MakeColor(255,255,0,255)*(1.f-T); @@ -243,14 +243,14 @@ final function color GetMsgColor(bool bDamage, int Count) event PostRender() { - if(GUIController!=None && PlayerOwner.PlayerInput==None) + if (GUIController!=None && PlayerOwner.PlayerInput==None) GUIController.NotifyLevelChange(); - if(KFGRI==None) + if (KFGRI==None) KFGRI = KFGameReplicationInfo(WorldInfo.GRI); - if(GUIController==None || GUIController.bIsInvalid) + if (GUIController==None || GUIController.bIsInvalid) { GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner); - if(GUIController!=None) + if (GUIController!=None) GUIStyle = GUIController.CurrentStyle; } GUIStyle.Canvas = Canvas; @@ -266,41 +266,41 @@ event PostRender() PLCameraDir = vector(PLCameraRot); PLCameraDot = (PLCameraDir Dot PLCameraLoc); - if(MyCurrentPet.Length>0) + if (MyCurrentPet.Length>0) DrawPetInfo(); - if(EPRI==None) + if (EPRI==None) EPRI = ExtPlayerReplicationInfo(KFPlayerOwner.PlayerReplicationInfo); - else if(EPRI.RespawnCounter>0) + else if (EPRI.RespawnCounter>0) DrawRespawnCounter(); bMeAdmin = (EPRI!=None && EPRI.AdminType<=1); - if(KillMessages.Length>0) + if (KillMessages.Length>0) RenderKillMsg(); - if(DeathMessages.Length>0) + if (DeathMessages.Length>0) RenderDMMessages(); - if(NewItems.Length>0) + if (NewItems.Length>0) DrawItemsList(); - if(bShowProgress || PlayerOwner.Player==None) + if (bShowProgress || PlayerOwner.Player==None) { - if(ProgressMsgTime6.f) + if (T>6.f) { KillMessages.Remove(i--,1); continue; } - if(KillMessages[i].bDamage) + if (KillMessages[i].bDamage) S = "-"$KillMessages[i].Counter$" HP "$KillMessages[i].Name; - else if(KillMessages[i].bLocal) + else if (KillMessages[i].bLocal) S = "+"$KillMessages[i].Counter@KillMessages[i].Name$(KillMessages[i].Counter>1 ? " kills" : " kill"); else S = (KillMessages[i].OwnerPRI!=None ? KillMessages[i].OwnerPRI.GetHumanReadableName() : "Someone")$" +"$KillMessages[i].Counter@KillMessages[i].Name$(KillMessages[i].Counter>1 ? " kills" : " kill"); Canvas.SetPos(X,Y); @@ -373,10 +373,10 @@ final function RenderDMMessages() Canvas.Font = GUIStyle.PickFont(GUIStyle.DefaultFontSize+1,Sc); Y = Canvas.ClipY*0.98; - for(i=0; i6.f) + if (T>6.f) { DeathMessages.Remove(i--,1); continue; @@ -393,22 +393,22 @@ final function RenderDMMessages() // Now strip text into color tag pieces. S = DeathMessages[i].Msg; - while(true) + while (true) { Canvas.SetPos(X,Y); j = InStr(S,Chr(6)); - if(j==-1) + if (j==-1) { Canvas.DrawText(S,,Sc,Sc); break; } - if(j>0) + if (j>0) { Canvas.DrawText(Left(S,j),,Sc,Sc); Canvas.TextSize(Left(S,j),XL,YL,Sc,Sc); X+=XL; } - switch(Mid(S,j+1,1)) + switch (Mid(S,j+1,1)) { case "O": // Blue victim color. Canvas.SetDrawColor(32,32,255,a); @@ -430,12 +430,12 @@ final function RenderProgress() local int i; Canvas.Font = GUIStyle.PickFont(GUIStyle.DefaultFontSize+1,Sc); - if(bProgressDC) + if (bProgressDC) Canvas.SetDrawColor(255,80,80,255); else Canvas.SetDrawColor(255,255,255,255); Y = Canvas.ClipY*0.2; - for(i=0; i 0.f) + if (`TimeSince(KFPH.Mesh.LastRenderTime) < 0.2f && Normal(PlayerPartyInfoLocation - ViewLocation) dot ViewVector > 0.f) { - if(DrawFriendlyHumanPlayerInfo(KFPH)) + if (DrawFriendlyHumanPlayerInfo(KFPH)) { VisibleHumanPlayers.AddItem(KFPH.PlayerReplicationInfo); } @@ -536,7 +536,7 @@ function DrawHUD() } } - if(!KFGRI.bHidePawnIcons) + if (!KFGRI.bHidePawnIcons) { // Draw hidden players CheckAndDrawHiddenPlayerIcons(VisibleHumanPlayers, HiddenHumanPlayers); @@ -545,7 +545,7 @@ function DrawHUD() CheckAndDrawRemainingZedIcons(); //Draw our current objective location - if(KFGRI.CurrentObjective != none && KFGRI.ObjectiveInterface != none) + if (KFGRI.CurrentObjective != none && KFGRI.ObjectiveInterface != none) { KFGRI.ObjectiveInterface.DrawHUD(self, Canvas); @@ -564,7 +564,7 @@ function DrawHUD() Canvas.EnableStencilTest(false); } } - else if(KFPawn_Monster(PlayerOwner.Pawn)!=None) + else if (KFPawn_Monster(PlayerOwner.Pawn)!=None) { // Draw human health auras. DotScale = Canvas.ClipX*0.2f; @@ -572,19 +572,19 @@ function DrawHUD() { PawnLocation = KFPH.Location; - if(IsZero(PawnLocation)) + if (IsZero(PawnLocation)) { continue; } ThisDot = (PLCameraDir Dot PawnLocation) - PLCameraDot; - if(KFPH.IsAliveAndWell() && ThisDot>0.f && ThisDot<10000.f) + if (KFPH.IsAliveAndWell() && ThisDot>0.f && ThisDot<10000.f) { V = Canvas.Project(PawnLocation); - if(V.X<-100 || V.X>(Canvas.SizeX+100) || V.Y<-100 || V.Y>(Canvas.SizeY+100)) + if (V.X<-100 || V.X>(Canvas.SizeX+100) || V.Y<-100 || V.Y>(Canvas.SizeY+100)) continue; Canvas.DrawColor = GetHPColorScale(KFPH); - if(PlayerOwner.FastTrace(PawnLocation,PLCameraLoc)) + if (PlayerOwner.FastTrace(PawnLocation,PLCameraLoc)) ThisDot*=1.75f; ThisDot = (DotScale/ThisDot)*350.f; Canvas.SetPos(V.X-ThisDot*0.25f,V.Y-ThisDot*0.5f); @@ -592,14 +592,14 @@ function DrawHUD() } } - if(!class'ExtPlayerController'.Default.bHideNameBeacons) + if (!class'ExtPlayerController'.Default.bHideNameBeacons) { Canvas.EnableStencilTest(true); // Draw zed health bars. foreach WorldInfo.AllPawns(class'KFPawn_Monster', M) { ThisDot = (PLCameraDir Dot (M.Location + M.CylinderComponent.CollisionHeight * vect(0,0,1))) - PLCameraDot; - if(ThisDot>0 && ThisDot<8000.f && M.IsAliveAndWell() && M.PlayerReplicationInfo!=None && M!=PlayerOwner.Pawn && (WorldInfo.TimeSeconds - M.Mesh.LastRenderTime) < 0.4f) + if (ThisDot>0 && ThisDot<8000.f && M.IsAliveAndWell() && M.PlayerReplicationInfo!=None && M!=PlayerOwner.Pawn && (WorldInfo.TimeSeconds - M.Mesh.LastRenderTime) < 0.4f) DrawFriendlyHUDZ(M); } Canvas.EnableStencilTest(false); @@ -611,14 +611,14 @@ simulated static final function color GetHPColorScale(Pawn P) { local color C; - if(P.Health<25) // Red + if (P.Health<25) // Red C.R = 255; - else if(P.Health<75) // Yellow -> Red + else if (P.Health<75) // Yellow -> Red { C.G = (P.Health-25) * 5.1f; C.R = 255; } - else if(P.Health<100) // Green -> Yellow + else if (P.Health<100) // Green -> Yellow { C.G = 255; C.R = (100-P.Health) * 10.2f; @@ -645,7 +645,7 @@ simulated function DrawFriendlyHUDZ(KFPawn_Monster KFPH) TargetLocation = KFPH.Location + vect(0,0,1) * KFPH.GetCollisionHeight() * 1.2; ScreenPos = Canvas.Project(TargetLocation); - if(ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY) + if (ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY) return; //Draw health bar @@ -679,7 +679,7 @@ simulated function bool DrawFriendlyHumanPlayerInfo(KFPawn_Human KFPH) ResModifier = WorldInfo.static.GetResolutionBasedHUDScale() * FriendlyHudScale; KFPRI = ExtPlayerReplicationInfo(KFPH.PlayerReplicationInfo); - if(KFPRI == none) + if (KFPRI == none) { return false; } @@ -691,7 +691,7 @@ simulated function bool DrawFriendlyHumanPlayerInfo(KFPawn_Human KFPH) TargetLocation = KFPH.Mesh.GetPosition() + (KFPH.CylinderComponent.CollisionHeight * vect(0,0,2.5f)); ScreenPos = Canvas.Project(TargetLocation); - if(ScreenPos.X < 0 || ScreenPos.X > Canvas.ClipX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.ClipY) + if (ScreenPos.X < 0 || ScreenPos.X > Canvas.ClipX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.ClipY) { return false; } @@ -702,19 +702,19 @@ simulated function bool DrawFriendlyHumanPlayerInfo(KFPawn_Human KFPH) // drop shadow for player name text S = KFPRI.PlayerName; - if(KFPRI.bBot) + if (KFPRI.bBot) { S = S$" (Bot)"; TextColor = KFPRI.HUDPerkColor; } - else if(KFPRI.ShowAdminName()) // Admin info. + else if (KFPRI.ShowAdminName()) // Admin info. { S = S$" ("$KFPRI.GetAdminNameAbr()$")"; TextColor = KFPRI.GetAdminColorC(); } else TextColor = PlayerBarTextColor; - if(bMeAdmin && KFPRI.FixedData>0) + if (bMeAdmin && KFPRI.FixedData>0) { TextColor = MakeColor(255,0,0,255); S @= "-"$KFPRI.GetDesc(); @@ -743,7 +743,7 @@ simulated function bool DrawFriendlyHumanPlayerInfo(KFPawn_Human KFPH) CurrentHealthColor.A = FadeAlpha; DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + BarHeight * 2 + (36 * FontScale * ResModifier), CurrentHealthColor, FadeAlpha, true); - if(KFPRI.ECurrentPerk == None) + if (KFPRI.ECurrentPerk == None) { return false; } @@ -800,7 +800,7 @@ simulated final function DrawPlayerInfoBar(KFPawn P, float BarPercentage, float Canvas.SetPos(XPos, YPos); Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength * BarPercentage, BarHeight, 0, 0, 32, 32); - if(bDrawingHealth && ExtHumanPawn(P) != None && P.Health0) + if (bDrawingHealth && ExtHumanPawn(P) != None && P.Health0) { // Draw to-regen bar. XPos+=(BarLength * BarPercentage); @@ -887,7 +887,7 @@ simulated function DrawMonsterHUD(KFPawn KFPH) local byte FadeAlpha; PRI = Ext_T_MonsterPRI(KFPH.PlayerReplicationInfo); - if(PRI==None) + if (PRI==None) return; FadeAlpha = DrawToDistance(KFPH); @@ -899,7 +899,7 @@ simulated function DrawMonsterHUD(KFPawn KFPH) TargetLocation = KFPH.Location + vect(0,0,1) * KFPH.GetCollisionHeight() * 0.8; ScreenPos = Canvas.Project(TargetLocation); - if(ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY) + if (ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY) return; //Draw health bar @@ -942,9 +942,9 @@ simulated function DrawPetInfo() GUIStyle.DrawRectBox(X, Y + YS, BestPetXL * 1.04, YL * MyCurrentPet.Length, 4); Canvas.DrawColor = MakeColor(32,250,32,255); - for(i=0; i BestPetXL) + if (XL > BestPetXL) BestPetXL = XL; - if(YL > BestPetYL) + if (YL > BestPetYL) BestPetYL = YL; } } @@ -1019,7 +1019,7 @@ final function AddNumberMsg(int Amount, vector Pos, byte Type) } DamagePopups[NextDamagePopupIndex].FontColor = C; - if(++NextDamagePopupIndex >= DAMAGEPOPUP_COUNT) + if (++NextDamagePopupIndex >= DAMAGEPOPUP_COUNT) NextDamagePopupIndex=0; } @@ -1039,14 +1039,14 @@ final function DrawDamage() KFPlayerController(Owner).GetPlayerViewPoint(CameraLocation, CameraRotation); CamDir = vector(CameraRotation); - for(i=0; i < DAMAGEPOPUP_COUNT ; i++) + for (i=0; i < DAMAGEPOPUP_COUNT ; i++) { TimeSinceHit = WorldInfo.TimeSeconds - DamagePopups[i].HitTime; - if(TimeSinceHit > DamagePopupFadeOutTime + if (TimeSinceHit > DamagePopupFadeOutTime || (Normal(DamagePopups[i].HitLocation - CameraLocation) dot Normal(CamDir) < 0.1)) //don't draw if player faced back to the hit location continue; - switch(DamagePopups[i].Type) + switch (DamagePopups[i].Type) { case 0: // Pawn damage. S = "-"$string(DamagePopups[i].Damage); @@ -1087,18 +1087,18 @@ simulated function SearchInventoryForNewItem() { local int i,j; - if(WasNewlyAdded.Length!=OnlineSub.CurrentInventory.Length) + if (WasNewlyAdded.Length!=OnlineSub.CurrentInventory.Length) WasNewlyAdded.Length = OnlineSub.CurrentInventory.Length; - for(i=0; i=10.f) + if (T>=10.f) { NewItems.Remove(i--,1); continue; } - if(T>9.f) + if (T>9.f) { T = 255.f * (10.f-T); Canvas.SetDrawColor(255,255,255,T); @@ -1153,7 +1153,7 @@ simulated final function DrawItemsList() Canvas.TextSize(NewItems[i].Item,XS,YS,FontScale,FontScale); - /*if(NewItems[i].Icon!=None) + /*if (NewItems[i].Icon!=None) { Canvas.SetPos(XPos-YSize,YPos); Canvas.DrawRect(YSize,YSize,NewItems[i].Icon); @@ -1172,7 +1172,7 @@ simulated final function DrawItemsList() simulated function CheckForItems() { - if(KFGameReplicationInfo(WorldInfo.GRI)!=none) + if (KFGameReplicationInfo(WorldInfo.GRI)!=none) KFGameReplicationInfo(WorldInfo.GRI).ProcessChanceDrop(); SetTimer(260+FRand()*220.f,false,'CheckForItems'); } diff --git a/ServerExt/Classes/KFGUI_Base.uc b/ServerExt/Classes/KFGUI_Base.uc index 18d7221..a339974 100644 --- a/ServerExt/Classes/KFGUI_Base.uc +++ b/ServerExt/Classes/KFGUI_Base.uc @@ -48,9 +48,9 @@ function CloseMenu(); // Menu was closed. function MenuTick(float DeltaTime) { - if(bTimerActive && (TimerCounter-=DeltaTime)<=0.f) + if (bTimerActive && (TimerCounter-=DeltaTime)<=0.f) { - if(bLoopTimer) + if (bLoopTimer) TimerCounter = TimerRate; else bTimerActive = false; Timer(); @@ -59,7 +59,7 @@ function MenuTick(float DeltaTime) final function SetTimer(float Rate, optional bool bLoop) { bTimerActive = (Rate>0.f); - if(bTimerActive) + if (bTimerActive) { bLoopTimer = bLoop; TimerRate = Rate; @@ -116,14 +116,14 @@ final function KFGUI_Base GetMouseFocus() { local KFGUI_Base M; - for(M=Self; M.MouseArea!=None; M=M.MouseArea) + for (M=Self; M.MouseArea!=None; M=M.MouseArea) {} return M; } function DoClose() { - if(ParentComponent!=None) + if (ParentComponent!=None) ParentComponent.DoClose(); else Owner.PopCloseMenu(Self); } @@ -135,13 +135,13 @@ function byte GetCursorStyle() function UserPressedEsc() // user pressed escape while this menu was active. { - if(ParentComponent!=None) + if (ParentComponent!=None) ParentComponent.UserPressedEsc(); else DoClose(); } function bool BringPageToFront() { - if(ParentComponent!=None) + if (ParentComponent!=None) return ParentComponent.BringPageToFront(); return true; // Allow user to bring this page to front. } @@ -153,32 +153,32 @@ final function KFGUI_Page GetPageTop() { local KFGUI_Base M; - for(M=Self; M.ParentComponent!=None; M=M.ParentComponent) + for (M=Self; M.ParentComponent!=None; M=M.ParentComponent) {} return KFGUI_Page(M); } function KFGUI_Base FindComponentID(name InID) { - if(ID==InID) + if (ID==InID) return Self; return None; } function FindAllComponentID(name InID, out array Res) { - if(ID==InID) + if (ID==InID) Res[Res.Length] = Self; } function RemoveComponent(KFGUI_Base B); function GetInputFocus() { - if(Owner.InputFocus!=None) + if (Owner.InputFocus!=None) Owner.InputFocus.LostInputFocus(); Owner.InputFocus = Self; } function DropInputFocus() { - if(Owner.InputFocus==Self) + if (Owner.InputFocus==Self) { Owner.InputFocus.LostInputFocus(); Owner.InputFocus = None; @@ -193,7 +193,7 @@ final function GrabKeyFocus() } final function ReleaseKeyFocus() { - if(Owner.KeyboardFocus==Self) + if (Owner.KeyboardFocus==Self) Owner.GrabInputFocus(None); } function LostKeyFocus(); @@ -228,7 +228,7 @@ simulated final function PlayMenuSound(EMenuSound Slot) { /*local SoundCue S; - switch(Slot) + switch (Slot) { case MN_Focus: S = SoundCue'a_interface.menu.UT3MenuMouseOverCue'; @@ -252,7 +252,7 @@ simulated final function PlayMenuSound(EMenuSound Slot) S = SoundCue'a_interface.menu.UT3MenuNavigateUpCue'; break; } - if(S!=None) + if (S!=None) GetPlayer().PlaySound(S,true,,false);*/ } @@ -275,7 +275,7 @@ static final function string MakeSortStr(int Value) // Prefix with zeroes to properly sort this string. S = string(Value); i = Len(S); - if(i<10) + if (i<10) return Mid("0000000000",i)$S; return S; } diff --git a/ServerExt/Classes/KFGUI_Button.uc b/ServerExt/Classes/KFGUI_Button.uc index 73e4563..4dbfd7e 100644 --- a/ServerExt/Classes/KFGUI_Button.uc +++ b/ServerExt/Classes/KFGUI_Button.uc @@ -15,7 +15,7 @@ function DrawMenu() function HandleMouseClick(bool bRight) { PlayMenuSound(MN_ClickButton); - if(bRight) + if (bRight) OnClickRight(Self); else OnClickLeft(Self); } diff --git a/ServerExt/Classes/KFGUI_Button_CD.uc b/ServerExt/Classes/KFGUI_Button_CD.uc index 6efc17b..2ee539b 100644 --- a/ServerExt/Classes/KFGUI_Button_CD.uc +++ b/ServerExt/Classes/KFGUI_Button_CD.uc @@ -6,15 +6,15 @@ function DrawMenu() local byte i, FrameOpacity; FrameOpacity = 200; - if(bDisabled) + if (bDisabled) Canvas.SetDrawColor(10, 10, 10, FrameOpacity); - else if(bPressedDown) + else if (bPressedDown) Canvas.SetDrawColor(20, 20, 20, FrameOpacity); - else if(bFocused) + else if (bFocused) Canvas.SetDrawColor(75, 75, 75, FrameOpacity); else Canvas.SetDrawColor(45, 45, 45, FrameOpacity); - if(bIsHighlighted) + if (bIsHighlighted) { Canvas.DrawColor.R = Min(Canvas.DrawColor.R + 25, FrameOpacity); Canvas.DrawColor.G = Min(Canvas.DrawColor.G + 25, FrameOpacity); @@ -22,29 +22,29 @@ function DrawMenu() } Canvas.SetPos(0.f,0.f); - if(ExtravDir==255) + if (ExtravDir==255) Owner.CurrentStyle.DrawWhiteBox(CompPos[2],CompPos[3]); else Owner.CurrentStyle.DrawRectBox(0,0,CompPos[2],CompPos[3],Min(CompPos[2],CompPos[3])*0.2,ExtravDir); - if(OverlayTexture.Texture!=None) + if (OverlayTexture.Texture!=None) { Canvas.SetPos(0.f,0.f); Canvas.DrawTile(OverlayTexture.Texture,CompPos[2],CompPos[3],OverlayTexture.U,OverlayTexture.V,OverlayTexture.UL,OverlayTexture.VL); } - if(ButtonText!="") + if (ButtonText!="") { // Chose the best font to fit this button. i = Min(FontScale+Owner.CurrentStyle.DefaultFontSize,Owner.CurrentStyle.MaxFontScale); - while(true) + while (true) { Canvas.Font = Owner.CurrentStyle.PickFont(i,TS); Canvas.TextSize(ButtonText,XL,YL,TS,TS); - if(i==0 || (XL<(CompPos[2]*0.95) && YL<(CompPos[3]*0.95))) + if (i==0 || (XL<(CompPos[2]*0.95) && YL<(CompPos[3]*0.95))) break; --i; } Canvas.SetPos((CompPos[2]-XL)*0.5,(CompPos[3]-YL)*0.5); - if(bDisabled) + if (bDisabled) Canvas.DrawColor = TextColor*0.5f; else Canvas.DrawColor = TextColor; Canvas.DrawText(ButtonText,,TS,TS,TextFontInfo); diff --git a/ServerExt/Classes/KFGUI_CheckBox.uc b/ServerExt/Classes/KFGUI_CheckBox.uc index c676e00..5f4edd5 100644 --- a/ServerExt/Classes/KFGUI_CheckBox.uc +++ b/ServerExt/Classes/KFGUI_CheckBox.uc @@ -6,7 +6,7 @@ var() bool bForceUniform,bChecked; function UpdateSizes() { Super.UpdateSizes(); - if(bForceUniform) + if (bForceUniform) XSize = (YSize*InputPos[3]) / InputPos[2]; } @@ -18,7 +18,7 @@ function DrawMenu() function HandleMouseClick(bool bRight) { bChecked = !bChecked; - if(bChecked) + if (bChecked) PlayMenuSound(MN_ClickCheckboxOn); else PlayMenuSound(MN_ClickCheckboxOff); OnCheckChange(Self); diff --git a/ServerExt/Classes/KFGUI_Clickable.uc b/ServerExt/Classes/KFGUI_Clickable.uc index 4065f93..300fa39 100644 --- a/ServerExt/Classes/KFGUI_Clickable.uc +++ b/ServerExt/Classes/KFGUI_Clickable.uc @@ -16,7 +16,7 @@ function InitMenu() } function MouseClick(bool bRight) { - if(!bDisabled) + if (!bDisabled) { PressedDown[byte(bRight)] = 1; bPressedDown = true; @@ -24,7 +24,7 @@ function MouseClick(bool bRight) } function MouseRelease(bool bRight) { - if(!bDisabled && PressedDown[byte(bRight)]==1) + if (!bDisabled && PressedDown[byte(bRight)]==1) { PressedDown[byte(bRight)] = 0; bPressedDown = (PressedDown[0]!=0 || PressedDown[1]!=0); @@ -34,7 +34,7 @@ function MouseRelease(bool bRight) function MouseLeave() { Super.MouseLeave(); - if(!bDisabled) + if (!bDisabled) PlayMenuSound(MN_LostFocus); PressedDown[0] = 0; PressedDown[1] = 0; @@ -43,7 +43,7 @@ function MouseLeave() function MouseEnter() { Super.MouseEnter(); - if(!bDisabled) + if (!bDisabled) PlayMenuSound(MN_Focus); } @@ -58,9 +58,9 @@ function SetDisabled(bool bDisable) function NotifyMousePaused() { - if(Owner.InputFocus==None && ToolTip!="") + if (Owner.InputFocus==None && ToolTip!="") { - if(ToolTipItem==None) + if (ToolTipItem==None) { ToolTipItem = New(None)Class'KFGUI_Tooltip'; ToolTipItem.Owner = Owner; @@ -76,7 +76,7 @@ function NotifyMousePaused() } final function ChangeToolTip(string S) { - if(ToolTipItem!=None) + if (ToolTipItem!=None) ToolTipItem.SetText(S); else ToolTip = S; } diff --git a/ServerExt/Classes/KFGUI_ColumnList.uc b/ServerExt/Classes/KFGUI_ColumnList.uc index 49ddcaf..83abd7c 100644 --- a/ServerExt/Classes/KFGUI_ColumnList.uc +++ b/ServerExt/Classes/KFGUI_ColumnList.uc @@ -37,7 +37,7 @@ function KFGUI_ListItem AddLine(string Value, optional int iValue, optional stri local int i; // Allocate list item object. - if(UnusedItem!=None) + if (UnusedItem!=None) { N = UnusedItem; UnusedItem = N.Next; @@ -49,27 +49,27 @@ function KFGUI_ListItem AddLine(string Value, optional int iValue, optional stri N.SetValue(Value,iValue,SortValue); // Insert into list. - if(bShouldSortList && Index==-1) + if (bShouldSortList && Index==-1) { N.Temp = N.GetSortStr(LastSortedColumn); - if(ListCount==0) // No sorting needed yet. + if (ListCount==0) // No sorting needed yet. { N.Next = FirstItem; FirstItem = N; } - else if(bLastSortedReverse) + else if (bLastSortedReverse) { - if(FirstItem.TempN.Temp) + else if (FirstItem.Temp>N.Temp) { N.Next = FirstItem; FirstItem = N; } else { - for(O=FirstItem; O!=None; O=O.Next) + for (O=FirstItem; O!=None; O=O.Next) { - if(O.Next==None || O.Next.Temp>N.Temp) + if (O.Next==None || O.Next.Temp>N.Temp) { N.Next = O.Next; O.Next = N; @@ -96,9 +96,9 @@ function KFGUI_ListItem AddLine(string Value, optional int iValue, optional stri } } } - else if(Index==-1 || Index>ListCount) + else if (Index==-1 || Index>ListCount) Index = ListCount; - if(Index==0) + if (Index==0) { N.Next = FirstItem; FirstItem = N; @@ -106,9 +106,9 @@ function KFGUI_ListItem AddLine(string Value, optional int iValue, optional stri else { i = 0; - for(O=FirstItem; O!=None; O=O.Next) + for (O=FirstItem; O!=None; O=O.Next) { - if((++i)==Index) + if ((++i)==Index) { N.Next = O.Next; O.Next = N; @@ -124,22 +124,22 @@ final function RemoveLine(KFGUI_ListItem I) { local KFGUI_ListItem N; - if(I.Index==-1) + if (I.Index==-1) return; // Update selected row info. - if(SelectedRowIndex==I.Index) + if (SelectedRowIndex==I.Index) SelectedRowIndex = -1; - else if(SelectedRowIndex>I.Index) + else if (SelectedRowIndex>I.Index) --SelectedRowIndex; // Remove from list. - if(FirstItem==I) + if (FirstItem==I) FirstItem = I.Next; else { - for(N=FirstItem; N!=None; N=N.Next) - if(N.Next==I) + for (N=FirstItem; N!=None; N=N.Next) + if (N.Next==I) { N.Next = I.Next; break; @@ -157,7 +157,7 @@ final function EmptyList() { local KFGUI_ListItem N,I; - for(I=FirstItem; I!=None; I=N) + for (I=FirstItem; I!=None; I=N) { N = I.Next; @@ -175,10 +175,10 @@ final function KFGUI_ListItem GetFromIndex(int Index) { local KFGUI_ListItem N; - if(Index<0 || Index>=ListCount) + if (Index<0 || Index>=ListCount) return None; - for(N=FirstItem; N!=None; N=N.Next) - if((Index--)==0) + for (N=FirstItem; N!=None; N=N.Next) + if ((Index--)==0) return N; return None; } @@ -189,7 +189,7 @@ function SortColumn(int Column, optional bool bReverse) local KFGUI_ListItem Sel,N,P; local int i; - if(!bCanSortColumn || Column<0 || Column>=Columns.Length) + if (!bCanSortColumn || Column<0 || Column>=Columns.Length) return; LastSortedColumn = Column; @@ -205,20 +205,20 @@ function SortColumn(int Column, optional bool bReverse) SelectedRowIndex = -1; // Slow, sort it all. - for(N=FirstItem; N!=None; N=N.Next) + for (N=FirstItem; N!=None; N=N.Next) { N.Temp = N.GetSortStr(Column); - if(bReverse) + if (bReverse) { - for(i=0; iN.Temp) + for (i=0; iN.Temp) break; } List.Insert(i,1); @@ -228,14 +228,14 @@ function SortColumn(int Column, optional bool bReverse) // Rebuild list. FirstItem = None; P = None; - for(i=0; i=ListCount) + if (SelectedRowIndex>=ListCount) SelectedRowIndex = -1; OldItemsPerFrame = ListItemsPerPage; bListSizeDirty = false; diff --git a/ServerExt/Classes/KFGUI_ColumnTop.uc b/ServerExt/Classes/KFGUI_ColumnTop.uc index 51385a5..3c05565 100644 --- a/ServerExt/Classes/KFGUI_ColumnTop.uc +++ b/ServerExt/Classes/KFGUI_ColumnTop.uc @@ -24,35 +24,35 @@ function DrawMenu() MinSize = ColumnMinSize / CompPos[2]; // Scale column - if(bScaleColumn) + if (bScaleColumn) { MouseX = Owner.MousePosition.X - CompPos[0]; - for(i=0; i=(1.f-MinSize)) + if (X>=(1.f-MinSize)) { MouseX = X-(1.f-MinSize); // Grab overshoot. // Then push back! - for(j=i; j>=0; --j) + for (j=i; j>=0; --j) { - if((ListOwner.Columns[j].Width-MouseX)>MinSize) // This column has enough space to retract. + if ((ListOwner.Columns[j].Width-MouseX)>MinSize) // This column has enough space to retract. { ListOwner.Columns[j].Width-=MouseX; MouseX = 0; break; } - else if(ListOwner.Columns[j].Width>MinSize) // This column has limited space to retract. + else if (ListOwner.Columns[j].Width>MinSize) // This column has limited space to retract. { MouseX-=(ListOwner.Columns[j].Width-MinSize); ListOwner.Columns[j].Width = MinSize; @@ -66,7 +66,7 @@ function DrawMenu() // Init mouse check. MouseColumn = -1; bCheckMouse = (bClickable && bFocused); - if(bCheckMouse) + if (bCheckMouse) { GrabWidth = CompPos[3]*0.175; MouseX = Owner.MousePosition.X - CompPos[0] - GrabWidth; @@ -76,17 +76,17 @@ function DrawMenu() // Draw the columns and compute the scalings. X = 0; j = (ListOwner.bShouldSortList ? ListOwner.LastSortedColumn : -1); - for(i=0; i=GrabWidth) && ((i+1)=CompPos[2]) + if (X>=CompPos[2]) ListOwner.Columns[i].bHidden = true; else { @@ -118,12 +118,12 @@ function DrawMenu() function MouseClick(bool bRight) { - if(!ListOwner.bDisabled && bClickable) + if (!ListOwner.bDisabled && bClickable) { PressedDown[byte(bRight)] = 1; bPressedDown = true; - if(!bRight && bMouseScaler) + if (!bRight && bMouseScaler) { PlayMenuSound(MN_ClickButton); bScaleColumn = true; @@ -134,22 +134,22 @@ function MouseClick(bool bRight) } function MouseRelease(bool bRight) { - if(bScaleColumn && !bRight) + if (bScaleColumn && !bRight) { bScaleColumn = false; DropInputFocus(); return; } - if(!bDisabled && bClickable && PressedDown[byte(bRight)]==1) + if (!bDisabled && bClickable && PressedDown[byte(bRight)]==1) { PlayMenuSound(MN_ClickButton); PressedDown[byte(bRight)] = 0; bPressedDown = (PressedDown[0]!=0 || PressedDown[1]!=0); - if(MouseColumn>=0) + if (MouseColumn>=0) { ListOwner.SortColumn(MouseColumn,(PrevSortedColumn==MouseColumn)); - if(PrevSortedColumn==MouseColumn) + if (PrevSortedColumn==MouseColumn) PrevSortedColumn = -1; else PrevSortedColumn = MouseColumn; } @@ -157,14 +157,14 @@ function MouseRelease(bool bRight) } function byte GetCursorStyle() { - if(bClickable) + if (bClickable) return (bMouseScaler ? 2 : 1); return 0; } function MouseLeave() { Super.MouseLeave(); - if(!bScaleColumn) + if (!bScaleColumn) { PressedDown[0] = 0; PressedDown[1] = 0; diff --git a/ServerExt/Classes/KFGUI_ComboBox.uc b/ServerExt/Classes/KFGUI_ComboBox.uc index 12743bc..6027f4d 100644 --- a/ServerExt/Classes/KFGUI_ComboBox.uc +++ b/ServerExt/Classes/KFGUI_ComboBox.uc @@ -11,7 +11,7 @@ var() bool bButtonStretched; function UpdateSizes() { // Update height. - if(bScaleByFontSize) + if (bScaleByFontSize) YSize = (TextHeight + (BorderSize*2)) / InputPos[3]; } @@ -23,7 +23,7 @@ function DrawMenu() function HandleMouseClick(bool bRight) { PlayMenuSound(MN_Dropdown); - if(Selection==None) + if (Selection==None) { Selection = New(None)Class'KFGUI_ComboSelector'; Selection.Owner = Owner; @@ -34,13 +34,13 @@ function HandleMouseClick(bool bRight) Selection.YPosition = (CompPos[1]+CompPos[3]) / Owner.ScreenSize.Y; Selection.XSize = CompPos[2] / Owner.ScreenSize.X; Selection.YSize = (TextHeight / Owner.ScreenSize.Y) * Values.Length + ((BorderSize*2) / Owner.ScreenSize.Y); - if((Selection.YPosition+Selection.YSize)>1.f) + if ((Selection.YPosition+Selection.YSize)>1.f) Selection.YPosition-=((Selection.YPosition+Selection.YSize)-1.f); Selection.GetInputFocus(); } final function string GetCurrent() { - if(SelectedIndex=0) + if (CurrentRow>=0) { Combo.SelectedIndex = CurrentRow; Combo.OnComboChanged(Combo); diff --git a/ServerExt/Classes/KFGUI_ComponentList.uc b/ServerExt/Classes/KFGUI_ComponentList.uc index 483a6bf..6f10561 100644 --- a/ServerExt/Classes/KFGUI_ComponentList.uc +++ b/ServerExt/Classes/KFGUI_ComponentList.uc @@ -11,7 +11,7 @@ final function KFGUI_Base AddListComponent(class CompClass, optional local KFGUI_Base G; G = new(Self)CompClass; - if(G==None) + if (G==None) return None; G.XPosition = (1.f - XS) * 0.5f; G.YPosition = (1.f - YS) * 0.5f; @@ -52,16 +52,16 @@ function PreDraw() // Update list size i = ItemComponents.Length / NumColumns; - if(i!=NumColumns) + if (i!=NumColumns) { ListCount = i; UpdateListVis(); } // First draw scrollbar to allow it to resize itself. - for(j=0; j<4; ++j) + for (j=0; j<4; ++j) ScrollBar.InputPos[j] = CompPos[j]; - if(OldXSize!=InputPos[2]) + if (OldXSize!=InputPos[2]) { OldXSize = InputPos[2]; ScrollBar.XPosition = 1.f - ScrollBar.GetWidth(); @@ -82,7 +82,7 @@ function PreDraw() YS = CompPos[3] / ListItemsPerPage; VisRange[0] = (ScrollBar.CurrentScroll*NumColumns); VisRange[1] = ItemComponents.Length; - for(i=VisRange[0]; i0.5f) + if (XS>0.5f) XS = (1.f-XS); Canvas.DrawColor = C*(Sin(XS*2.f*Pi)*0.45f); - if(bAllSelected) + if (bAllSelected) { Canvas.TextSize(Mid(Value,ScrollOffset),XS,YS,TextScale,TextScale); Canvas.SetPos(X,Y); @@ -53,14 +53,14 @@ function DrawMenu() } else { - if(ScrollOffset>(TypePos-4)) + if (ScrollOffset>(TypePos-4)) ScrollOffset = Max(TypePos-4,0); Retry: Canvas.TextSize(Mid(Value,ScrollOffset,TypePos-ScrollOffset),XS,YS,TextScale,TextScale); Canvas.SetPos(X+XS,Y); - if(Canvas.CurX<(CompPos[2]-X)) + if (Canvas.CurX<(CompPos[2]-X)) Canvas.DrawText("|",,TextScale,TextScale,TextFontInfo); else { @@ -69,11 +69,11 @@ Retry: } } } - if(Value!="") + if (Value!="") { Canvas.DrawColor = C; Canvas.SetPos(X,Y); - if(ScrollOffset>5) + if (ScrollOffset>5) ScrollOffset = Min(ScrollOffset,Len(Value)-6); DrawClippedText(Mid(Value,ScrollOffset),TextScale,CompPos[2]); @@ -86,61 +86,61 @@ Retry: function bool NotifyInputKey(int ControllerId, name Key, EInputEvent Event, float AmountDepressed, bool bGamepad) { - if(Owner.CheckMouse(Key,Event)) + if (Owner.CheckMouse(Key,Event)) return true; - if(Key=='LeftControl') + if (Key=='LeftControl') { bHoldCtrl = (Event!=IE_Released); } - else if(Event == IE_Released) + else if (Event == IE_Released) { - if(Key=='Escape' || Key=='Enter') + if (Key=='Escape' || Key=='Enter') { - if(Key=='Enter' && OnHitEnter(Self)) + if (Key=='Enter' && OnHitEnter(Self)) return true; ReleaseKeyFocus(); } } - else if(Event==IE_Pressed || Event==IE_Repeat) + else if (Event==IE_Pressed || Event==IE_Repeat) { - if(Key=='backspace') + if (Key=='backspace') { - if(bAllSelected) + if (bAllSelected) { bTextDirty = (Value!=""); Value = ""; TypePos = 0; bAllSelected = false; } - else if(TypePos>0) + else if (TypePos>0) { bTextDirty = true; - if(TypePos==Len(Value)) + if (TypePos==Len(Value)) Value = Left(Value,TypePos-1); else Value = Left(Value,TypePos-1)$Mid(Value,TypePos); --TypePos; } } - else if(Key=='delete') + else if (Key=='delete') { - if(bAllSelected) + if (bAllSelected) { bTextDirty = (Value!=""); Value = ""; TypePos = 0; bAllSelected = false; } - else if(TypePosMaxTextLength) + if ((bAllSelected ? (Len(Value)+Len(S)) : Len(S))>MaxTextLength) return; bTextDirty = true; - if(bAllSelected) + if (bAllSelected) { bAllSelected = false; Value = S; TypePos = 0; } - else if(TypePos==Len(Value)) + else if (TypePos==Len(Value)) Value $= S; else Value = Left(Value,TypePos) $ S $ Mid(Value,TypePos); TypePos+=Len(S); } function bool NotifyInputChar(int ControllerId, string Unicode) { - if((!bAllSelected && Len(Value)>=MaxTextLength) || (bHoldCtrl && (Unicode~="C" || Unicode~="X" || Unicode~="V"))) + if ((!bAllSelected && Len(Value)>=MaxTextLength) || (bHoldCtrl && (Unicode~="C" || Unicode~="X" || Unicode~="V"))) return true; - if(Asc(Unicode)>=32) // Skip system characters. + if (Asc(Unicode)>=32) // Skip system characters. { bTextDirty = true; - if(bAllSelected) + if (bAllSelected) { bAllSelected = false; Value = Unicode; TypePos = 0; } - else if(TypePos==Len(Value)) + else if (TypePos==Len(Value)) Value $= Unicode; else Value = Left(Value,TypePos) $ Unicode $ Mid(Value,TypePos); ++TypePos; @@ -231,9 +231,9 @@ function bool NotifyInputChar(int ControllerId, string Unicode) function HandleMouseClick(bool bRight) { PlayMenuSound(MN_ClickButton); - if(bIsTyping) + if (bIsTyping) { - if(Value!="") + if (Value!="") bAllSelected = !bAllSelected; } else @@ -247,7 +247,7 @@ function HandleMouseClick(bool bRight) function LostKeyFocus() { - if(bTextDirty) + if (bTextDirty) { OnTextChange(Self); bTextDirty = false; diff --git a/ServerExt/Classes/KFGUI_EditControl.uc b/ServerExt/Classes/KFGUI_EditControl.uc index 98d1592..99f76ee 100644 --- a/ServerExt/Classes/KFGUI_EditControl.uc +++ b/ServerExt/Classes/KFGUI_EditControl.uc @@ -13,7 +13,7 @@ var(Lable) bool bScaleByFontSize; // Scale this component height by font height. function InitMenu() { - if(LableString=="") + if (LableString=="") TextLable = None; else { @@ -37,7 +37,7 @@ function InitMenu() function UpdateSizes() { // Update height. - if(bScaleByFontSize) + if (bScaleByFontSize) YSize = ((TextHeight*1.05) + 6) / InputPos[3]; } @@ -53,11 +53,11 @@ function PreDraw() UpdateSizes(); Super.PreDraw(); - if(TextLable!=None) + if (TextLable!=None) { TextLable.YSize = YSize; TextLable.Canvas = Canvas; - for(i=0; i<4; ++i) + for (i=0; i<4; ++i) TextLable.InputPos[i] = InputPos[i]; TextLable.PreDraw(); } @@ -69,10 +69,10 @@ final function DrawClippedText(string S, float TScale, float MaxX) local float X,XL,YL; l = Len(S); - for(i=0; iMaxX) + if ((Canvas.CurX+X+XL)>MaxX) { --i; break; diff --git a/ServerExt/Classes/KFGUI_FloatingWindow.uc b/ServerExt/Classes/KFGUI_FloatingWindow.uc index 88c0e0c..6130a6d 100644 --- a/ServerExt/Classes/KFGUI_FloatingWindow.uc +++ b/ServerExt/Classes/KFGUI_FloatingWindow.uc @@ -16,7 +16,7 @@ function DrawMenu() { Owner.CurrentStyle.RenderFramedWindow(Self); - if(HeaderComp!=None) + if (HeaderComp!=None) { HeaderComp.CompPos[3] = Owner.CurrentStyle.DefaultHeight; HeaderComp.YSize = HeaderComp.CompPos[3] / CompPos[3]; // Keep header height fit the window height. @@ -25,7 +25,7 @@ function DrawMenu() function SetWindowDrag(bool bDrag) { bDragWindow = bDrag; - if(bDrag) + if (bDrag) { DragOffset[0] = Owner.MousePosition.X-CompPos[0]; DragOffset[1] = Owner.MousePosition.Y-CompPos[1]; @@ -33,7 +33,7 @@ function SetWindowDrag(bool bDrag) } function bool CaptureMouse() { - if(bDragWindow && HeaderComp!=None) // Always keep focus on window frame now! + if (bDragWindow && HeaderComp!=None) // Always keep focus on window frame now! { MouseArea = HeaderComp; return true; @@ -42,7 +42,7 @@ function bool CaptureMouse() } function PreDraw() { - if(bDragWindow) + if (bDragWindow) { XPosition = FClamp(Owner.MousePosition.X-DragOffset[0],0,InputPos[2]-CompPos[2]) / InputPos[2]; YPosition = FClamp(Owner.MousePosition.Y-DragOffset[1],0,InputPos[3]-CompPos[3]) / InputPos[3]; diff --git a/ServerExt/Classes/KFGUI_FloatingWindowHeader.uc b/ServerExt/Classes/KFGUI_FloatingWindowHeader.uc index bf5aac6..7bcfb26 100644 --- a/ServerExt/Classes/KFGUI_FloatingWindowHeader.uc +++ b/ServerExt/Classes/KFGUI_FloatingWindowHeader.uc @@ -8,12 +8,12 @@ function PreDraw() } function MouseClick(bool bRight) { - if(!bRight) + if (!bRight) KFGUI_FloatingWindow(ParentComponent).SetWindowDrag(true); } function MouseRelease(bool bRight) { - if(!bRight) + if (!bRight) KFGUI_FloatingWindow(ParentComponent).SetWindowDrag(false); } diff --git a/ServerExt/Classes/KFGUI_List.uc b/ServerExt/Classes/KFGUI_List.uc index caa70a5..4c11d6d 100644 --- a/ServerExt/Classes/KFGUI_List.uc +++ b/ServerExt/Classes/KFGUI_List.uc @@ -32,7 +32,7 @@ function DrawMenu() local float Y; local bool bCheckMouse; - if(bDrawBackground) + if (bDrawBackground) { Canvas.DrawColor = BackgroundColor; Canvas.SetPos(0.f,0.f); @@ -42,19 +42,19 @@ function DrawMenu() // Mouse focused item check. bCheckMouse = bClickable && bFocused; FocusMouseItem = -1; - if(bCheckMouse) + if (bCheckMouse) MouseYHit = Owner.MousePosition.Y - CompPos[1]; n = ScrollBar.CurrentScroll; ItemHeight = CompPos[3] / ListItemsPerPage; Y = 0; - for(i=0; i=ListCount) + if (n>=ListCount) break; - if(bCheckMouse && FocusMouseItem==-1) + if (bCheckMouse && FocusMouseItem==-1) { - if(MouseYHit=0) + if (Owner.InputFocus==None && FocusMouseItem>=0) OnMouseRest(FocusMouseItem); } diff --git a/ServerExt/Classes/KFGUI_ListItem.uc b/ServerExt/Classes/KFGUI_ListItem.uc index 3229901..319c8a4 100644 --- a/ServerExt/Classes/KFGUI_ListItem.uc +++ b/ServerExt/Classes/KFGUI_ListItem.uc @@ -10,7 +10,7 @@ var transient string Temp; // Cache sorting key. function SetValue(string S, int i, string SortStr) { ParseStringIntoArray(S,Columns,"\n",false); - if(SortStr=="") + if (SortStr=="") SortColumns.Length = 0; else ParseStringIntoArray(Caps(SortStr),SortColumns,"\n",false); Value = i; @@ -19,7 +19,7 @@ function SetValue(string S, int i, string SortStr) // Return string to draw on HUD. function string GetDisplayStr(int Column) { - if(Column0) + if (SortColumns.Length>0) { - if(Column Res) { local int i; - if(ID==InID) + if (ID==InID) Res[Res.Length] = Self; - for(i=0; i=48 && ControllerId<=57) || ControllerId==46) + if ((ControllerId>=48 && ControllerId<=57) || ControllerId==46) Super.NotifyInputChar(ControllerId,Unicode); return true; } diff --git a/ServerExt/Classes/KFGUI_RightClickMenu.uc b/ServerExt/Classes/KFGUI_RightClickMenu.uc index 089cac6..69913bb 100644 --- a/ServerExt/Classes/KFGUI_RightClickMenu.uc +++ b/ServerExt/Classes/KFGUI_RightClickMenu.uc @@ -20,9 +20,9 @@ function OpenMenu(KFGUI_Base Menu) ComputeSize(); XPosition = float(Owner.MousePosition.X+4) / Owner.ScreenSize.X; YPosition = float(Owner.MousePosition.Y+4) / Owner.ScreenSize.Y; - if((XPosition+XSize)>1.f) + if ((XPosition+XSize)>1.f) YPosition = (float(Owner.MousePosition.X) / Owner.ScreenSize.X) - XSize; // Move to left side of mouse pointer. - if((YPosition+YSize)>1.f) + if ((YPosition+YSize)>1.f) YPosition-=((YPosition+YSize)-1.f); // Move up until fit on screen. GetInputFocus(); } @@ -33,7 +33,7 @@ final function ComputeSize() local Font F; local string S; - if(ItemRows.Length==0) + if (ItemRows.Length==0) { YS = 0; XS = 50; @@ -43,9 +43,9 @@ final function ComputeSize() YS = Owner.CurrentStyle.DefaultHeight * ItemRows.Length; XS = 20; F = Owner.CurrentStyle.PickFont(Owner.CurrentStyle.DefaultFontSize,Scalar); - for(i=0; i=0 && (ItemRows[CurrentRow].bSplitter || ItemRows[CurrentRow].bDisabled)) + if (CurrentRow>=0 && (ItemRows[CurrentRow].bSplitter || ItemRows[CurrentRow].bDisabled)) return; PlayMenuSound(MN_ClickButton); DropInputFocus(); - if(CurrentRow>=0) + if (CurrentRow>=0) OnSelectedItem(CurrentRow); } function LostInputFocus() diff --git a/ServerExt/Classes/KFGUI_RightClickMenu_CD.uc b/ServerExt/Classes/KFGUI_RightClickMenu_CD.uc index 205c0f7..dd18a1e 100644 --- a/ServerExt/Classes/KFGUI_RightClickMenu_CD.uc +++ b/ServerExt/Classes/KFGUI_RightClickMenu_CD.uc @@ -27,9 +27,9 @@ function DrawMenu() CurrentRow = -1; Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX,Canvas.ClipY); - for(i=0; i=YP && Y<=(YP+Owner.CurrentStyle.DefaultHeight)) + if (bCheckMouse && Y>=YP && Y<=(YP+Owner.CurrentStyle.DefaultHeight)) { bCheckMouse = false; CurrentRow = i; @@ -39,14 +39,14 @@ function DrawMenu() } Canvas.SetPos(Edge,YP); - if(ItemRows[i].bSplitter) + if (ItemRows[i].bSplitter) { Canvas.SetDrawColor(255,255,255,255); Canvas.DrawText("-------",,TextScale,TextScale); } else { - if(ItemRows[i].bDisabled) + if (ItemRows[i].bDisabled) Canvas.SetDrawColor(148,148,148,255); else Canvas.SetDrawColor(248,248,248,255); Canvas.DrawText(ItemRows[i].Text,,TextScale,TextScale); @@ -55,7 +55,7 @@ function DrawMenu() YP+=Owner.CurrentStyle.DefaultHeight; } Canvas.PopMaskRegion(); - if(OldRow!=CurrentRow) + if (OldRow!=CurrentRow) { OldRow = CurrentRow; PlayMenuSound(MN_DropdownChange); diff --git a/ServerExt/Classes/KFGUI_ScrollBarBase.uc b/ServerExt/Classes/KFGUI_ScrollBarBase.uc index cf63b13..47aa62c 100644 --- a/ServerExt/Classes/KFGUI_ScrollBarBase.uc +++ b/ServerExt/Classes/KFGUI_ScrollBarBase.uc @@ -43,7 +43,7 @@ function float GetWidth() function PreDraw() { // Auto scale to match width to screen size. - if(bVertical) + if (bVertical) XSize = GetWidth(); else YSize = GetWidth(); Super.PreDraw(); @@ -54,39 +54,39 @@ function DrawMenu() } function MouseClick(bool bRight) { - if(bRight || bDisabled) + if (bRight || bDisabled) return; bPressedDown = true; PlayMenuSound(MN_ClickButton); - if(bVertical) + if (bVertical) { - if(Owner.MousePosition.Y>=(CompPos[1]+ButtonOffset) && Owner.MousePosition.Y<=(CompPos[1]+ButtonOffset+SliderScale)) // Grabbed scrollbar! + if (Owner.MousePosition.Y>=(CompPos[1]+ButtonOffset) && Owner.MousePosition.Y<=(CompPos[1]+ButtonOffset+SliderScale)) // Grabbed scrollbar! { GrabbedOffset = Owner.MousePosition.Y - (CompPos[1]+ButtonOffset); bGrabbedScroller = true; GetInputFocus(); } - else if(Owner.MousePosition.Y<(CompPos[1]+ButtonOffset)) // Page up. + else if (Owner.MousePosition.Y<(CompPos[1]+ButtonOffset)) // Page up. AddValue(-PageStep); else AddValue(PageStep); } else { - if(Owner.MousePosition.X>=(CompPos[0]+ButtonOffset) && Owner.MousePosition.X<=(CompPos[0]+ButtonOffset+SliderScale)) // Grabbed scrollbar! + if (Owner.MousePosition.X>=(CompPos[0]+ButtonOffset) && Owner.MousePosition.X<=(CompPos[0]+ButtonOffset+SliderScale)) // Grabbed scrollbar! { GrabbedOffset = Owner.MousePosition.X - (CompPos[0]+ButtonOffset); bGrabbedScroller = true; GetInputFocus(); } - else if(Owner.MousePosition.X<(CompPos[0]+ButtonOffset)) // Page left. + else if (Owner.MousePosition.X<(CompPos[0]+ButtonOffset)) // Page left. AddValue(-PageStep); else AddValue(PageStep); } } function MouseRelease(bool bRight) { - if(!bRight) + if (!bRight) DropInputFocus(); } @@ -98,9 +98,9 @@ function LostInputFocus() function ScrollMouseWheel(bool bUp) { - if(bDisabled) + if (bDisabled) return; - if(bUp) + if (bUp) AddValue(-ScrollStride); else AddValue(ScrollStride); } diff --git a/ServerExt/Classes/KFGUI_ScrollBarV_CD.uc b/ServerExt/Classes/KFGUI_ScrollBarV_CD.uc index af2a6ea..dd1148d 100644 --- a/ServerExt/Classes/KFGUI_ScrollBarV_CD.uc +++ b/ServerExt/Classes/KFGUI_ScrollBarV_CD.uc @@ -5,27 +5,27 @@ function DrawMenu() local float A; local byte i; - if(bDisabled) + if (bDisabled) Canvas.SetDrawColor(5, 5, 5, 0); - else if(bFocused || bGrabbedScroller) + else if (bFocused || bGrabbedScroller) Canvas.SetDrawColor(30, 30, 30, 160); else Canvas.SetDrawColor(30, 30, 30, 160); Owner.CurrentStyle.DrawRectBox (0.f, 0.f, CompPos[2], CompPos[3], 4); - if(bDisabled) + if (bDisabled) return; - if(bVertical) + if (bVertical) i = 3; else i = 2; SliderScale = FMax(PageStep * (CompPos[i] - 32.f) / (MaxRange + PageStep),CalcButtonScale); - if(bGrabbedScroller) + if (bGrabbedScroller) { // Track mouse. - if(bVertical) + if (bVertical) A = Owner.MousePosition.Y - CompPos[1] - GrabbedOffset; else A = Owner.MousePosition.X - CompPos[0] - GrabbedOffset; @@ -36,13 +36,13 @@ function DrawMenu() A = float(CurrentScroll) / float(MaxRange); ButtonOffset = A*(CompPos[i]-SliderScale); - if(bGrabbedScroller) + if (bGrabbedScroller) Canvas.SetDrawColor(90,90,90,255); - else if(bFocused) + else if (bFocused) Canvas.SetDrawColor(65,65,65,255); else Canvas.SetDrawColor(40,40,40,255); - if(bVertical) + if (bVertical) Owner.CurrentStyle.DrawRectBox (0.f, ButtonOffset, CompPos[2], SliderScale, 4); else Owner.CurrentStyle.DrawRectBox (ButtonOffset, 0.f, SliderScale, CompPos[3], 4); } diff --git a/ServerExt/Classes/KFGUI_SwitchComponent.uc b/ServerExt/Classes/KFGUI_SwitchComponent.uc index 64012c7..30b6323 100644 --- a/ServerExt/Classes/KFGUI_SwitchComponent.uc +++ b/ServerExt/Classes/KFGUI_SwitchComponent.uc @@ -8,17 +8,17 @@ function PreDraw() local byte j; ComputeCoords(); - if(CurrentComponent<0 || CurrentComponent>=Components.Length) + if (CurrentComponent<0 || CurrentComponent>=Components.Length) return; Components[CurrentComponent].Canvas = Canvas; - for(j=0; j<4; ++j) + for (j=0; j<4; ++j) Components[CurrentComponent].InputPos[j] = CompPos[j]; Components[CurrentComponent].PreDraw(); } function bool CaptureMouse() { - if((CurrentComponent>=0 || CurrentComponent=0 || CurrentComponent=0 && Num=0 && Num PageClass, optional out KFGU B.OnClickRight = PageSwitched; B.IDValue = NumButtons; - if(ButtonPosition<2) + if (ButtonPosition<2) { B.XPosition = NumButtons*ButtonAxisSize; B.XSize = ButtonAxisSize*0.99; - if(ButtonPosition==0) + if (ButtonPosition==0) B.YPosition = 0.f; else B.YPosition = YSize-BorderWidth*0.99; B.YSize = BorderWidth*0.99; - if(NumButtons>0) + if (NumButtons>0) PageButtons[PageButtons.Length-1].ExtravDir = 1; } else { - if(ButtonPosition==2) + if (ButtonPosition==2) B.XPosition = 0.f; else B.XPosition = XSize-BorderWidth*0.99; B.XSize = BorderWidth*0.99; B.YPosition = NumButtons*ButtonAxisSize; B.YSize = ButtonAxisSize*0.99; - if(NumButtons>0) + if (NumButtons>0) PageButtons[PageButtons.Length-1].ExtravDir = 2; } @@ -71,7 +71,7 @@ function PageSwitched(KFGUI_Button Sender) final function SelectPage(int Index) { - if(CurrentPageNum>=0) + if (CurrentPageNum>=0) { PageButtons[CurrentPageNum].bIsHighlighted = false; SubPages[CurrentPageNum].CloseMenu(); @@ -79,7 +79,7 @@ final function SelectPage(int Index) PageComponentIndex = -1; } CurrentPageNum = (Index>=0 && Index=0) + if (CurrentPageNum>=0) { PageButtons[CurrentPageNum].bIsHighlighted = true; SubPages[CurrentPageNum].ShowMenu(); @@ -93,20 +93,20 @@ function PreDraw() local int i; local byte j; - if(CurrentPageNum==-1 && NumButtons>0) + if (CurrentPageNum==-1 && NumButtons>0) SelectPage(0); ComputeCoords(); Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); DrawMenu(); - for(i=0; i0) + if (j>0) { Lines[i].Text.Length = z+1; Lines[i].Text[z].S = Left(S,j); Lines[i].Text[z].C = C; ++z; } - else if(j==-1) + else if (j==-1) break; S = Mid(S,j+2); - if(Left(S,4)=="DEF}") + if (Left(S,4)=="DEF}") { C.A = 0; S = Mid(S,4); @@ -100,11 +100,11 @@ final function byte GrabHexValue(string S) } final function byte HexToInt(byte n) { - if(n>=48 && n<=57) // '0' - '9' + if (n>=48 && n<=57) // '0' - '9' return n-48; - if(n>=65 && n<=70) // 'A' - 'F' + if (n>=65 && n<=70) // 'A' - 'F' return n-55; // 'A' - 10 - if(n>=97 && n<=102) // 'a' - 'f' + if (n>=97 && n<=102) // 'a' - 'f' return n-87; // 'a' - 10 return 0; } @@ -116,7 +116,7 @@ function InitSize() OldSize[0] = CompPos[2]; OldSize[1] = CompPos[3]; - if(!bTextParsed) + if (!bTextParsed) { ParseTextLines(); bTextParsed = true; @@ -135,9 +135,9 @@ function InitSize() bClickable = bShowScrollbar; bCanFocus = bShowScrollbar; - if(bShowScrollbar) + if (bShowScrollbar) { - if(ScrollBar==None) + if (ScrollBar==None) { ScrollBar = new(Self) class'KFGUI_ScrollBarV'; ScrollBar.SetPosition(0.9,0.0,0.1,1.0); @@ -147,7 +147,7 @@ function InitSize() } // Compute scrollbar size and X-position. - for(i=0; i<4; ++i) + for (i=0; i<4; ++i) ScrollBar.InputPos[i] = CompPos[i]; ScrollWidth = ScrollBar.GetWidth(); ScrollBar.XPosition = 1.f - ScrollWidth; @@ -159,12 +159,12 @@ function InitSize() Lines = OrgLines; ParseLines((CompPos[2]-ScrollWidth) / InitFontScale); - if(Components.Find(ScrollBar)==-1) + if (Components.Find(ScrollBar)==-1) Components.AddItem(ScrollBar); MaxHeight = (Lines.Length * TextHeight); ScrollBar.UpdateScrollSize(0,Max(((MaxHeight-CompPos[3])/TextHeight)+1,1),1,1); } - else if(ScrollBar!=None) + else if (ScrollBar!=None) Components.RemoveItem(ScrollBar); } @@ -174,16 +174,16 @@ final function ParseLines(float ClipX) local float X,XS,YS; local int i,j,z,n; - for(i=0; iClipX) + if ((X+XS)>ClipX) { z = FindSplitPoint(Lines[i].Text[j].S,X,ClipX); @@ -191,7 +191,7 @@ final function ParseLines(float ClipX) Lines.Insert(i+1,1); // Append the remaining lines there. - for(n=j; nClipX) // Split here if possible. + if (X>ClipX) // Split here if possible. { - if(PrevWord==0) + if (PrevWord==0) return (bStartedZero ? i : 0); // No wrap. return PrevWord; } @@ -256,7 +256,7 @@ final function int FindSplitPoint(string S, float X, float ClipX) } final function string StripWhiteSpaces(string S) { - if(Left(S,1)==" ") + if (Left(S,1)==" ") S = Mid(S,1); return S; } @@ -271,36 +271,36 @@ function DrawMenu() local int i,j; local float Y; - if(Text=="") + if (Text=="") return; // Need to figure out best fitting font. - if(OldSize[0]!=CompPos[2] || OldSize[1]!=CompPos[3]) + if (OldSize[0]!=CompPos[2] || OldSize[1]!=CompPos[3]) InitSize(); Canvas.Font = InitFont; - if(bShowScrollbar) + if (bShowScrollbar) { Canvas.SetClip(CompPos[0]+(CompPos[2]-ScrollWidth),CompPos[1]+CompPos[3]); i = ScrollBar.GetValue(); } else i = 0; - if(i=CompPos[3]) + if ((Lines[i].Y-Y+TextHeight)>=CompPos[3]) break; - for(j=0; jOwner.ScreenSize.X) + if ((X+TX)>Owner.ScreenSize.X) X = Owner.ScreenSize.X-TX; - if((Y+TY)>Owner.ScreenSize.Y) + if ((Y+TY)>Owner.ScreenSize.Y) Y = CompPos[1]-TY; - if(CurrentAlpha<255) + if (CurrentAlpha<255) CurrentAlpha = Min(CurrentAlpha+25,255); // Reset clipping. @@ -54,7 +54,7 @@ function PreDraw() Canvas.SetDrawColor(255,255,255,CurrentAlpha); X+=KF2Style(Owner.CurrentStyle).TOOLTIP_BORDER; Y+=KF2Style(Owner.CurrentStyle).TOOLTIP_BORDER; - for(i=0; iNormal2D(ExtB).Y) + if (Abs(V.X)>Normal2D(ExtB).Y) { - if(V.X<0) + if (V.X<0) HitNorm = vect(1,0,0); else HitNorm = vect(-1,0,0); } - else if(V.Y<0) + else if (V.Y<0) HitNorm = vect(0,1,0); else HitNorm = vect(0,-1,0); @@ -80,7 +80,7 @@ final function bool Box8DirTrace(vector Start, vector Dir, vector HitTest, vecto tmin = (V.X - Ext.X) * tmp; tmax = (V.X + Ext.X) * tmp; - if(tmin > tmax) + if (tmin > tmax) { tmp = tmax; tmax = tmin; @@ -99,7 +99,7 @@ final function bool Box8DirTrace(vector Start, vector Dir, vector HitTest, vecto } // Fully missed. - if((tmin > tymax) || (tymin > tmax)) + if ((tmin > tymax) || (tymin > tmax)) return false; if (tymin > tmin) @@ -114,21 +114,21 @@ final function bool Box8DirTrace(vector Start, vector Dir, vector HitTest, vecto tmax = tymax; } - if(tmin1.f) // Too far away + if (tmax<0.f || tmax>1.f) // Too far away return false; - if(bMaxY) + if (bMaxY) { - if(Dir.Y>0.f) + if (Dir.Y>0.f) HitNorm = vect(0,-1,0); else HitNorm = vect(0,1,0); } - else if(Dir.X>0.f) + else if (Dir.X>0.f) HitNorm = vect(-1,0,0); else HitNorm = vect(1,0,0); diff --git a/ServerExt/Classes/MX_PongGame.uc b/ServerExt/Classes/MX_PongGame.uc index 98aa091..992248b 100644 --- a/ServerExt/Classes/MX_PongGame.uc +++ b/ServerExt/Classes/MX_PongGame.uc @@ -29,10 +29,10 @@ function Init() local int i; Super.Init(); - if(Data!=0) + if (Data!=0) i = Data ^ InverseXOr; Score = (i >> 16) & 32767; - if(Score>31767) + if (Score>31767) Score = Score-32768; NumPlays = i & 65535; SetAIRating(); @@ -49,21 +49,21 @@ function SetFXTrack(Object O) local ObjectReferencer R; local int i; - if(SoundCue(O)!=None) + if (SoundCue(O)!=None) { HitSoundsA.AddItem(SoundCue(O)); HitSoundsB.AddItem(SoundCue(O)); } - else if(ObjectReferencer(O)!=None) + else if (ObjectReferencer(O)!=None) { R = ObjectReferencer(O); - if(R.ReferencedObjects.Length<2) + if (R.ReferencedObjects.Length<2) return; MissSound[0] = SoundCue(R.ReferencedObjects[0]); MissSound[1] = SoundCue(R.ReferencedObjects[1]); - for(i=2; i0.f) // Top. + else if (V.Y>0.f) // Top. { DY = (1.f - LevelBoarderSize - (BallHeight*0.5) - P.Y) / V.Y; - if(DY3) + if (AITactic>3) AITrajOffset = FMin((AITactic-3)*0.35,0.97)*(0.5-FRand())*(PadHeight+BallWidth); // Randomly chose to throw ball in the corners to give angular momentum. BallHeading = BH_ToEnemy; BallVel.X *= -1.05; @@ -300,20 +300,20 @@ function Tick(float Delta) } break; case BH_ToEnemy: - if(BallPos.X>1.f) + if (BallPos.X>1.f) PlayerScored(true); - else if((BallPos.X+V.X)>0.95) + else if ((BallPos.X+V.X)>0.95) { ExtA.X = PadWidth*0.5; ExtA.Y = PadHeight*0.5; ExtB.X = BallWidth*0.5; ExtB.Y = BallHeight*0.5; - if(Box8DirTrace(BallPos,V,EnemyPad-vect(0.5,0,0)*PadWidth,ExtB,ExtA,HN,DY)) + if (Box8DirTrace(BallPos,V,EnemyPad-vect(0.5,0,0)*PadWidth,ExtB,ExtA,HN,DY)) { BallPos+=(V*DY); V = vect(0,0,0); - if(HN.X>-0.25) // Hit edge of the paddle + if (HN.X>-0.25) // Hit edge of the paddle { PlayerScored(true); BallVel = MirrorVectorByNormal(BallVel,HN); @@ -332,10 +332,10 @@ function Tick(float Delta) // Check edges // Top. - if(V.Y<0.f) + if (V.Y<0.f) { DY = LevelBoarderSize + (BallHeight*0.5) - BallPos.Y; - if(DY>V.Y) + if (DY>V.Y) { DY = DY / V.Y; // Calc intersection time. BallPos+=(V*DY); @@ -346,10 +346,10 @@ function Tick(float Delta) } } // Bottom - if(V.Y>0.f) + if (V.Y>0.f) { DY = 1.f - LevelBoarderSize - (BallHeight*0.5) - BallPos.Y; - if(DY0.f) // Directly follow ball + if (AITactic>0.f) // Directly follow ball { bTraj = false; - if(AITactic<1.f) + if (AITactic<1.f) { - if(BallHeading==BH_ToEnemy) + if (BallHeading==BH_ToEnemy) bRand = BallPos.X>AITactic; } else { bRand = false; - if(AITactic>2.f && BallHeading==BH_ToEnemy) + if (AITactic>2.f && BallHeading==BH_ToEnemy) bTraj = (AITactic>=4.f || BallPos.X>(2.f - AITactic*0.5)); } - if(!bRand) + if (!bRand) { - if(bTraj) + if (bTraj) { - if(BallPos.X>0.5) + if (BallPos.X>0.5) HN.Y = BallTrajectory.Y+AITrajOffset-EnemyPad.Y; else HN.Y = BallTrajectory.Y-EnemyPad.Y; HN.X = FMin(2.f + ((AITactic-1.f)*3.f),13.f); // Calc paddle changespeed rate @@ -398,27 +398,27 @@ function Tick(float Delta) } // Update AI - if(bRand) // Random motion. + if (bRand) // Random motion. { - if(AITacticTimer(1.f-PadMoveLimit)) + else if (EnemyPad.Y>(1.f-PadMoveLimit)) { EnemyPad.Y = 1.f-PadMoveLimit; EnemyPadVel = FMin(EnemyPadVel,0.f); diff --git a/ServerExt/Classes/UIP_About.uc b/ServerExt/Classes/UIP_About.uc index 29d756d..b23fffb 100644 --- a/ServerExt/Classes/UIP_About.uc +++ b/ServerExt/Classes/UIP_About.uc @@ -45,7 +45,7 @@ private final function UniqueNetId GetAuthID() function ButtonClicked(KFGUI_Button Sender) { - switch(Sender.ID) + switch (Sender.ID) { case 'Forum': class'GameEngine'.static.GetOnlineSubsystem().OpenURL(ForumURL); diff --git a/ServerExt/Classes/UIP_AdminMenu.uc b/ServerExt/Classes/UIP_AdminMenu.uc index 08ac702..5a53fe5 100644 --- a/ServerExt/Classes/UIP_AdminMenu.uc +++ b/ServerExt/Classes/UIP_AdminMenu.uc @@ -100,7 +100,7 @@ function Timer() function SelectedRow(KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick) { - if(bRight || bDblClick) + if (bRight || bDblClick) { PlayerContext.ItemRows[0].Text = EditPlayer$" "$Item.Columns[0]; SelectedID = Item.Value; @@ -109,16 +109,16 @@ function SelectedRow(KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick) } function SelectedRCItem(int Index) { - if(Index>0 && !PlayerContext.ItemRows[Index].bSplitter) + if (Index>0 && !PlayerContext.ItemRows[Index].bSplitter) { - if(PlayerContext.ItemRows[Index].Value>=0) + if (PlayerContext.ItemRows[Index].Value>=0) ExtPlayerController(GetPlayer()).AdminRPGHandle(SelectedID,PlayerContext.ItemRows[Index].Value); else UI_AdminPerkLevel(Owner.OpenMenu(class'UI_AdminPerkLevel')).InitPage(SelectedID,-PlayerContext.ItemRows[Index].Value); } } function ButtonClicked(KFGUI_Button Sender) { - switch(Sender.ID) + switch (Sender.ID) { case 'MOTD': Owner.OpenMenu(class'UI_AdminMOTD'); diff --git a/ServerExt/Classes/UIP_MiniGame.uc b/ServerExt/Classes/UIP_MiniGame.uc index 7ceef4d..b705718 100644 --- a/ServerExt/Classes/UIP_MiniGame.uc +++ b/ServerExt/Classes/UIP_MiniGame.uc @@ -10,7 +10,7 @@ function ShowMenu() Level = GetPlayer().WorldInfo; LastUpdateTime = Level.RealTimeSeconds; - if(ActiveGame==None) + if (ActiveGame==None) { ActiveGame = new (GetPlayer()) class'MX_PongGame'; ActiveGame.Init(); diff --git a/ServerExt/Classes/UIP_News.uc b/ServerExt/Classes/UIP_News.uc index fae3801..47f4c59 100644 --- a/ServerExt/Classes/UIP_News.uc +++ b/ServerExt/Classes/UIP_News.uc @@ -26,7 +26,7 @@ function ShowMenu() Super.ShowMenu(); GRI = KFGameReplicationInfo(GetPlayer().WorldInfo.GRI); WebsiteButton.SetDisabled(GRI==None || GRI.ServerAdInfo.WebsiteLink==""); - if(!WebsiteButton.bDisabled) + if (!WebsiteButton.bDisabled) { WebsiteURL = GRI.ServerAdInfo.WebsiteLink; WebsiteButton.ChangeToolTip(WebsiteButtonToolTip$" "$WebsiteURL); @@ -34,13 +34,13 @@ function ShowMenu() } function Timer() { - if(!ExtPlayerController(GetPlayer()).bMOTDReceived) + if (!ExtPlayerController(GetPlayer()).bMOTDReceived) SetTimer(0.2,false); else NewsField.SetText(ExtPlayerController(GetPlayer()).ServerMOTD); } function ButtonClicked(KFGUI_Button Sender) { - switch(Sender.ID) + switch (Sender.ID) { case 'Website': class'GameEngine'.static.GetOnlineSubsystem().OpenURL(WebsiteURL); diff --git a/ServerExt/Classes/UIP_PerkSelection.uc b/ServerExt/Classes/UIP_PerkSelection.uc index 0d0482f..fa646b8 100644 --- a/ServerExt/Classes/UIP_PerkSelection.uc +++ b/ServerExt/Classes/UIP_PerkSelection.uc @@ -67,31 +67,31 @@ function Timer() local int i; CurrentManager = ExtPlayerController(GetPlayer()).ActivePerkManager; - if(CurrentManager!=None) + if (CurrentManager!=None) { - if(PrevPendingPerk!=None) + if (PrevPendingPerk!=None) { PendingPerk = CurrentManager.FindPerk(PrevPendingPerk); PrevPendingPerk = None; } PerkList.ChangeListSize(CurrentManager.UserPerks.Length); - if(PendingPerk!=None && !PendingPerk.bPerkNetReady) + if (PendingPerk!=None && !PendingPerk.bPerkNetReady) return; // Huge code block to handle stat updating, but actually pretty well optimized. - if(PendingPerk!=OldUsedPerk) + if (PendingPerk!=OldUsedPerk) { OldUsedPerk = PendingPerk; - if(PendingPerk!=None) + if (PendingPerk!=None) { OldPerkPoints = -1; - if(StatsList.ItemComponents.Length!=PendingPerk.PerkStats.Length) + if (StatsList.ItemComponents.Length!=PendingPerk.PerkStats.Length) { - if(StatsList.ItemComponents.Length=StatBuyers.Length) + if (i>=StatBuyers.Length) { StatBuyers[StatBuyers.Length] = UIR_PerkStat(StatsList.AddListComponent(class'UIR_PerkStat')); StatBuyers[i].StatIndex = i; @@ -104,41 +104,41 @@ function Timer() } } } - else if(StatsList.ItemComponents.Length>PendingPerk.PerkStats.Length) + else if (StatsList.ItemComponents.Length>PendingPerk.PerkStats.Length) { - for(i=PendingPerk.PerkStats.Length; i0) + if (j>0) { TraitsList.AddLine("--"$N.Static.GetUIInfo(PendingPerk),-1); TraitsList.ToolTip.AddItem(N.Static.GetUIDesc()); } - for(i=0; i=TC.Default.NumLevels) + if (PendingPerk.PerkTraits[i].CurrentLevel>=TC.Default.NumLevels) S = MaxStr$"\n"$NotAviable; else { S = PendingPerk.PerkTraits[i].CurrentLevel$"/"$TC.Default.NumLevels$"\n"; - if(TC.Static.MeetsRequirements(PendingPerk.PerkTraits[i].CurrentLevel,PendingPerk)) + if (TC.Static.MeetsRequirements(PendingPerk.PerkTraits[i].CurrentLevel,PendingPerk)) S $= string(TC.Static.GetTraitCost(PendingPerk.PerkTraits[i].CurrentLevel)); else S $= NotAviable; } @@ -203,20 +203,20 @@ function DrawPerkInfo(Canvas C, int Index, float YOffset, float Height, float Wi local Ext_PerkBase P; local float Sc; - if(CurrentManager==None || Index>=CurrentManager.UserPerks.Length) + if (CurrentManager==None || Index>=CurrentManager.UserPerks.Length) return; P = CurrentManager.UserPerks[Index]; - if(P.Class==ExtPlayerReplicationInfo(GetPlayer().PlayerReplicationInfo).ECurrentPerk) + if (P.Class==ExtPlayerReplicationInfo(GetPlayer().PlayerReplicationInfo).ECurrentPerk) { - if(PendingPerk==None) + if (PendingPerk==None) PendingPerk = P; C.SetDrawColor(164,164,32); } - else if(P==PendingPerk) + else if (P==PendingPerk) C.SetDrawColor(164,86,32); else C.SetDrawColor(32,32,128); - if(bFocus) + if (bFocus) { C.DrawColor.R+=15; C.DrawColor.G+=15; @@ -238,7 +238,7 @@ function DrawPerkInfo(Canvas C, int Index, float YOffset, float Height, float Wi } function SwitchedPerk(int Index, bool bRight, int MouseX, int MouseY) { - if(CurrentManager==None || Index>=CurrentManager.UserPerks.Length) + if (CurrentManager==None || Index>=CurrentManager.UserPerks.Length) return; PendingPerk = CurrentManager.UserPerks[Index]; @@ -247,7 +247,7 @@ function SwitchedPerk(int Index, bool bRight, int MouseX, int MouseY) function ShowTraitInfo(KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick) { local UIR_TraitInfoPopup T; - if((bRight || bDblClick) && Item.Value>=0) + if ((bRight || bDblClick) && Item.Value>=0) { T = UIR_TraitInfoPopup(Owner.OpenMenu(class'UIR_TraitInfoPopup')); T.ShowTraitInfo(Item.Value,PendingPerk); @@ -257,24 +257,24 @@ function ButtonClicked(KFGUI_Button Sender) { local KFGUI_Page T; - switch(Sender.ID) + switch (Sender.ID) { case 'Reset': - if(PendingPerk!=None) + if (PendingPerk!=None) { T = Owner.OpenMenu(class'UI_ResetWarning'); UI_ResetWarning(T).SetupTo(PendingPerk); } break; case 'Unload': - if(PendingPerk!=None) + if (PendingPerk!=None) { T = Owner.OpenMenu(class'UI_UnloadInfo'); UI_UnloadInfo(T).SetupTo(PendingPerk.Class); } break; case 'Prestige': - if(PendingPerk!=None) + if (PendingPerk!=None) { T = Owner.OpenMenu(class'UI_PrestigeNote'); UI_PrestigeNote(T).SetupTo(PendingPerk); diff --git a/ServerExt/Classes/UIP_PerkSelectionLobby.uc b/ServerExt/Classes/UIP_PerkSelectionLobby.uc index 28680fb..8bb345f 100644 --- a/ServerExt/Classes/UIP_PerkSelectionLobby.uc +++ b/ServerExt/Classes/UIP_PerkSelectionLobby.uc @@ -5,31 +5,31 @@ function Timer() local int i; CurrentManager = ExtPlayerController(GetPlayer()).ActivePerkManager; - if(CurrentManager!=None) + if (CurrentManager!=None) { - if(PrevPendingPerk!=None) + if (PrevPendingPerk!=None) { PendingPerk = CurrentManager.FindPerk(PrevPendingPerk); PrevPendingPerk = None; } PerkList.ChangeListSize(CurrentManager.UserPerks.Length); - if(PendingPerk!=None && !PendingPerk.bPerkNetReady) + if (PendingPerk!=None && !PendingPerk.bPerkNetReady) return; // Huge code block to handle stat updating, but actually pretty well optimized. - if(PendingPerk!=OldUsedPerk) + if (PendingPerk!=OldUsedPerk) { OldUsedPerk = PendingPerk; - if(PendingPerk!=None) + if (PendingPerk!=None) { OldPerkPoints = -1; - if(StatsList.ItemComponents.Length!=PendingPerk.PerkStats.Length) + if (StatsList.ItemComponents.Length!=PendingPerk.PerkStats.Length) { - if(StatsList.ItemComponents.Length=StatBuyers.Length) + if (i>=StatBuyers.Length) { StatBuyers[StatBuyers.Length] = UIR_PerkStat(StatsList.AddListComponent(class'UIR_PerkStat')); StatBuyers[i].StatIndex = i; @@ -42,16 +42,16 @@ function Timer() } } } - else if(StatsList.ItemComponents.Length>PendingPerk.PerkStats.Length) + else if (StatsList.ItemComponents.Length>PendingPerk.PerkStats.Length) { - for(i=PendingPerk.PerkStats.Length; i"); } } - else if(PendingPerk!=None && OldPerkPoints!=PendingPerk.CurrentSP) + else if (PendingPerk!=None && OldPerkPoints!=PendingPerk.CurrentSP) { OldPerkPoints = PendingPerk.CurrentSP; PerkLabel.SetText("Lv"$PendingPerk.GetLevelString()@PendingPerk.PerkName$" (Points: "$PendingPerk.CurrentSP$")"); - for(i=0; i0) + if (Days>0) S = Days$"d "$S; return S; } @@ -173,27 +173,27 @@ static final function string FormatInteger(int Val) S = string(Val); Val = Len(S); - if(Val<=3) + if (Val<=3) return S; - while(Val>3) + while (Val>3) { - if(O=="") + if (O=="") O = Right(S,3); else O = Right(S,3)$","$O; S = Left(S,Val-3); Val-=3; } - if(Val>0) + if (Val>0) O = S$","$O; return O; } function ButtonClicked(KFGUI_Button Sender) { - if(CurrentPageIndex==Sender.IDValue) + if (CurrentPageIndex==Sender.IDValue) return; - if(PreviousButton!=None) + if (PreviousButton!=None) PreviousButton.bIsHighlighted = false; Sender.bIsHighlighted = true; PreviousButton = Sender; @@ -207,14 +207,14 @@ function SelectedRow(KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick) local UniqueNetId Res; local PlayerReplicationInfo PRI; - if(bRight || bDblClick) + if (bRight || bDblClick) { - if(CurrentPageIndex==0) + if (CurrentPageIndex==0) { foreach GetPlayer().WorldInfo.GRI.PRIArray(PRI) - if(PRI.PlayerID==Item.Value) + if (PRI.PlayerID==Item.Value) break; - if(PRI==None || PRI.PlayerID!=Item.Value || PRI.bBot) + if (PRI==None || PRI.PlayerID!=Item.Value || PRI.bBot) return; Res = PRI.UniqueId; } diff --git a/ServerExt/Classes/UIP_Settings.uc b/ServerExt/Classes/UIP_Settings.uc index 6e994cd..4bef127 100644 --- a/ServerExt/Classes/UIP_Settings.uc +++ b/ServerExt/Classes/UIP_Settings.uc @@ -38,7 +38,7 @@ function InitMenu() //AddCheckBox("Text-To-Speech:","Enable Text-to-Speech talk for player chat messages",'TTS', bool bDefault); AddCheckBox(FirstPersonLegsText,FirstPersonLegsToolTip,'FP',class'ExtPlayerController'.Default.bShowFPLegs); - if(class'ExtPlayerController'.Default.bShowFPLegs) + if (class'ExtPlayerController'.Default.bShowFPLegs) ExtPlayerController(GetPlayer()).ToggleFPBody(false); AddCheckBox(HideNameBeaconsText,HideNameBeaconsToolTip,'NB',class'ExtPlayerController'.Default.bHideNameBeacons); AddCheckBox(HideKillMessagesText,HideKillMessagesToolTip,'KM',class'ExtPlayerController'.Default.bHideKillMsg); @@ -61,9 +61,9 @@ final function InitBehindviewKey() // Check what keys now using! IN = Owner.BackupInput; - for(i=0; i 1) + if (MyPerk.PerkStats[StatIndex].CostPerValue > 1) CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue; else CurrentCost = 0; @@ -78,13 +78,13 @@ final function CheckBuyLimit() i = Max(Min(MyPerk.CurrentSP/MyPerk.PerkStats[StatIndex].CostPerValue,MyPerk.PerkStats[StatIndex].MaxValue-MyPerk.PerkStats[StatIndex].CurrentValue),0); StatCountBox.MaxValue = i; - if(i==0) + if (i==0) StatCountBox.MinValue = 0; else StatCountBox.MinValue = 1; // Make the value clamped. StatCountBox.ChangeValue(StatCountBox.Value); - if(MyPerk.PerkStats[StatIndex].CostPerValue > 1) + if (MyPerk.PerkStats[StatIndex].CostPerValue > 1) CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue; else CurrentCost = 0; @@ -106,9 +106,9 @@ final function string ChopExtraDigits(float Value) bLoop = true; // Chop off float digits that aren't needed. - while(bLoop) + while (bLoop) { - switch(Right(S,1)) + switch (Right(S,1)) { case "0": S = Left(S,Len(S)-1); diff --git a/ServerExt/Classes/UIR_PerkTraitList.uc b/ServerExt/Classes/UIR_PerkTraitList.uc index 4a00208..08bace1 100644 --- a/ServerExt/Classes/UIR_PerkTraitList.uc +++ b/ServerExt/Classes/UIR_PerkTraitList.uc @@ -42,13 +42,13 @@ function DrawMenu() // Mouse focused item check. bCheckMouse = bClickable && bFocused; FocusMouseItem = -1; - if(bCheckMouse) + if (bCheckMouse) MouseYHit = Owner.MousePosition.Y - CompPos[1]; n = ScrollBar.CurrentScroll; i = 0; - for(C=FirstItem; C!=None; C=C.Next) - if((i++)==n) + for (C=FirstItem; C!=None; C=C.Next) + if ((i++)==n) break; Y = 0.f; TextY = (ItemHeight-TextHeight)*0.5f; @@ -56,19 +56,19 @@ function DrawMenu() YClip = CompPos[1]+CompPos[3]; Canvas.SetDrawColor(250,250,250,255); - for(i=0; (i=MyTrait.Default.NumLevels) + if (OldLevel>=MyTrait.Default.NumLevels) { YesButton.ButtonText = ButtonBuyDisabledText; YesButton.SetDisabled(true); @@ -65,14 +65,14 @@ function Timer() } Cost = MyTrait.Static.GetTraitCost(OldLevel); YesButton.ButtonText = ButtonBuyText$" ("$Cost$")"; - if(Cost>OldPoints || !MyTrait.Static.MeetsRequirements(OldLevel,MyPerk)) + if (Cost>OldPoints || !MyTrait.Static.MeetsRequirements(OldLevel,MyPerk)) YesButton.SetDisabled(true); else YesButton.SetDisabled(false); } } function ButtonClicked(KFGUI_Button Sender) { - switch(Sender.ID) + switch (Sender.ID) { case 'Yes': ExtPlayerController(GetPlayer()).BoughtTrait(MyPerk.Class,MyTrait); diff --git a/ServerExt/Classes/UI_AdminMOTD.uc b/ServerExt/Classes/UI_AdminMOTD.uc index 63253dd..1b4430a 100644 --- a/ServerExt/Classes/UI_AdminMOTD.uc +++ b/ServerExt/Classes/UI_AdminMOTD.uc @@ -34,7 +34,7 @@ function InitMenu() } function Timer() { - if(!ExtPlayerController(GetPlayer()).bMOTDReceived) + if (!ExtPlayerController(GetPlayer()).bMOTDReceived) SetTimer(0.2,false); else { @@ -46,11 +46,11 @@ function ButtonClicked(KFGUI_Button Sender) { local string S; - switch(Sender.ID) + switch (Sender.ID) { case 'Yes': S = EditField.Value; - while(Len(S)>510) + while (Len(S)>510) { ExtPlayerController(GetPlayer()).ServerSetMOTD(Left(S,500),false); S = Mid(S,500); diff --git a/ServerExt/Classes/UI_AdminPerkLevel.uc b/ServerExt/Classes/UI_AdminPerkLevel.uc index 5b0d2a5..da4216b 100644 --- a/ServerExt/Classes/UI_AdminPerkLevel.uc +++ b/ServerExt/Classes/UI_AdminPerkLevel.uc @@ -42,7 +42,7 @@ final function InitPage(int UserID, byte Mode) if (PRI.PlayerID==UserID) break; } - if(ExtPlayerReplicationInfo(PRI)==None) + if (ExtPlayerReplicationInfo(PRI)==None) { WindowTitle = Mode==1 ? WindowTitleSetLevel : WindowTitleSetPrestigeLevel; return; @@ -53,7 +53,7 @@ final function InitPage(int UserID, byte Mode) } function ButtonClicked(KFGUI_Button Sender) { - switch(Sender.ID) + switch (Sender.ID) { case 'Yes': ExtPlayerController(GetPlayer()).AdminRPGHandle(PlayerID,BaseValue+LevelBox.GetValueInt()); diff --git a/ServerExt/Classes/UI_MidGameMenu.uc b/ServerExt/Classes/UI_MidGameMenu.uc index bb9e73a..83b7a65 100644 --- a/ServerExt/Classes/UI_MidGameMenu.uc +++ b/ServerExt/Classes/UI_MidGameMenu.uc @@ -42,10 +42,10 @@ function InitMenu() AddMenuButton('Disconnect',DisconnectButtonText,DisconnectButtonToolTip); AddMenuButton('Exit',ExitButtonText,ExitButtonToolTip); - for(i=0; i0 && PrevButton!=None) + if (NumButtons>0 && PrevButton!=None) PrevButton.ExtravDir = 1; PrevButton = B; - if(++NumButtons>8) + if (++NumButtons>8) { ++NumButtonRows; NumButtons = 0; diff --git a/ServerExt/Classes/UI_ResetWarning.uc b/ServerExt/Classes/UI_ResetWarning.uc index cae4c09..0b4e0b3 100644 --- a/ServerExt/Classes/UI_ResetWarning.uc +++ b/ServerExt/Classes/UI_ResetWarning.uc @@ -33,7 +33,7 @@ function SetupTo(Ext_PerkBase P) } function ButtonClicked(KFGUI_Button Sender) { - switch(Sender.ID) + switch (Sender.ID) { case 'Yes': ExtPlayerController(GetPlayer()).ServerResetPerk(PerkToReset,bIsPrestige); diff --git a/ServerExt/Classes/UI_Scoreboard.uc b/ServerExt/Classes/UI_Scoreboard.uc index 994ec6e..da8402f 100644 --- a/ServerExt/Classes/UI_Scoreboard.uc +++ b/ServerExt/Classes/UI_Scoreboard.uc @@ -79,11 +79,11 @@ function ShowMenu() Owner.bAbsorbInput = false; PC = ExtPlayerController(GetPlayer()); bAdmin = PC!=None && (PC.WorldInfo.NetMode!=NM_Client || (PC.PlayerReplicationInfo!=None && PC.PlayerReplicationInfo.bAdmin)); - if(PC!=None && (InitAdminSize!=PC.AdminCommands.Length || !bAdmin)) + if (PC!=None && (InitAdminSize!=PC.AdminCommands.Length || !bAdmin)) { InitAdminSize = (bAdmin ? PC.AdminCommands.Length : 0); PlayerContext.ItemRows.Length = 4+InitAdminSize; - for(i=0; i0; --i) + for (i=(KFGRI.PRIArray.Length-1); i>0; --i) { - for(j=i-1; j>=0; --j) - if(!InOrder(KFGRI.PRIArray[i],KFGRI.PRIArray[j])) + for (j=i-1; j>=0; --j) + if (!InOrder(KFGRI.PRIArray[i],KFGRI.PRIArray[j])) { PRI = KFGRI.PRIArray[i]; KFGRI.PRIArray[i] = KFGRI.PRIArray[j]; @@ -140,30 +140,30 @@ function DrawMenu() // Check players. PlayerIndex = -1; NumPlayer = 0; - for(i=(KFGRI.PRIArray.Length-1); i>=0; --i) + for (i=(KFGRI.PRIArray.Length-1); i>=0; --i) { KPRI = ExtPlayerReplicationInfo(KFGRI.PRIArray[i]); - if(KPRI==None || KPRI.bHiddenUser) + if (KPRI==None || KPRI.bHiddenUser) continue; - if(KPRI.bOnlySpectator) + if (KPRI.bOnlySpectator) { ++NumSpec; continue; } - if(KPRI.PlayerHealth>0 && KPRI.PlayerHealthPercent>0 && KPRI.GetTeamNum()==0) + if (KPRI.PlayerHealth>0 && KPRI.PlayerHealthPercent>0 && KPRI.GetTeamNum()==0) ++NumAlivePlayer; ++NumPlayer; } PRIList.Length = (bShowSpectatorsOnly ? NumSpec : NumPlayer); j = PRIList.Length; - for(i=(KFGRI.PRIArray.Length-1); i>=0; --i) + for (i=(KFGRI.PRIArray.Length-1); i>=0; --i) { KPRI = ExtPlayerReplicationInfo(KFGRI.PRIArray[i]); - if(KPRI!=None && bShowSpectatorsOnly==KPRI.bOnlySpectator) + if (KPRI!=None && bShowSpectatorsOnly==KPRI.bOnlySpectator) { PRIList[--j] = KPRI; - if(KPRI==PC.PlayerReplicationInfo) + if (KPRI==PC.PlayerReplicationInfo) PlayerIndex = j; } } @@ -175,7 +175,7 @@ function DrawMenu() YHeight = YL*5.f; // Draw header. - if(Canvas.ClipX<1000) + if (Canvas.ClipX<1000) { XPos = Canvas.ClipX*0.2; XScale = Canvas.ClipX*0.6; @@ -199,7 +199,7 @@ function DrawMenu() Canvas.SetPos(XPos+26,Y); Canvas.DrawText(KFGRI.ServerName,,FontScalar,FontScalar); - if(KFGRI.GameClass!=None) + if (KFGRI.GameClass!=None) { Y+=YL; Canvas.SetPos(XPos+26,Y); @@ -225,7 +225,7 @@ function DrawMenu() // Scoreboard title line. Canvas.Font = Owner.CurrentStyle.PickFont(DefFont,FontScalar); YL = Owner.CurrentStyle.DefaultHeight; - if(Canvas.ClipX<1000) + if (Canvas.ClipX<1000) { XPos = Canvas.ClipX*0.175; XScale = Canvas.ClipX*0.65; @@ -237,7 +237,7 @@ function DrawMenu() } YPos += YHeight*1.05; YHeight = YL; - if(bShowSpectatorsOnly) + if (bShowSpectatorsOnly) Canvas.SetDrawColor(32,32,128,FrameOpacity); else Canvas.SetDrawColor(128,32,32,FrameOpacity); Owner.CurrentStyle.DrawRectBox(XPos,YPos,XScale,YHeight,16,2); @@ -253,7 +253,7 @@ function DrawMenu() Y = YPos+4; Canvas.SetPos(XPos+18,Y); Canvas.DrawText(HeaderPlayerText,,FontScalar,FontScalar); - if(!bShowSpectatorsOnly) + if (!bShowSpectatorsOnly) { Canvas.SetPos(XPos+CashXPos,Y); Canvas.DrawText(HeaderDoshText,,FontScalar,FontScalar); @@ -266,12 +266,12 @@ function DrawMenu() YPos+=(YHeight-1); YHeight = (Canvas.ClipY*0.95) - YPos; i = DefFont+2; - while(i>0) + while (i>0) { Canvas.Font = Owner.CurrentStyle.PickFont(i,SBFontSize); Canvas.TextSize("A",XL,SBFontHeight,SBFontSize,SBFontSize); BoxHeight = SBFontHeight*2.f+ScoreboardSpacing; - if((BoxHeight*PRIList.Length)<=YHeight) + if ((BoxHeight*PRIList.Length)<=YHeight) break; --i; } @@ -295,7 +295,7 @@ final function Texture2D FindAvatar(UniqueNetId ClientID) local string S; S = KFPlayerController(GetPlayer()).GetSteamAvatar(ClientID); - if(S=="") + if (S=="") return None; return Texture2D(FindObject(S,class'Texture2D')); } @@ -326,7 +326,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float local float XPos,YPos,XL,YL; local string S; - if(Index==0) + if (Index==0) { // Setup font info. C.Font = SBFont; @@ -336,51 +336,51 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float bFocus = bFocus || (bHasSelectedPlayer && RightClickPlayer==PRI); // Draw name entry background. - if(PRI.bOnlySpectator) // Spectator - blue. + if (PRI.bOnlySpectator) // Spectator - blue. { - if(bFocus) + if (bFocus) C.SetDrawColor(86,86,212,FrameOpacity); else C.SetDrawColor(48,48,164,FrameOpacity); } - else if(PRI.Team==None) // Unteamed - Grey. + else if (PRI.Team==None) // Unteamed - Grey. { - if(bFocus) + if (bFocus) C.SetDrawColor(86,86,86,FrameOpacity); else C.SetDrawColor(48,48,48,FrameOpacity); } else { - switch(PRI.Team.TeamIndex) + switch (PRI.Team.TeamIndex) { case 0: // Humans - Red. - if(bFocus) + if (bFocus) C.SetDrawColor(160,48,48,FrameOpacity); else C.SetDrawColor(128,32,32,FrameOpacity); break; default: // Rest - Green. - if(bFocus) + if (bFocus) C.SetDrawColor(48,160,48,FrameOpacity); else C.SetDrawColor(32,128,32,FrameOpacity); } } - if(PRI.PlayerHealth<=0 || PRI.PlayerHealthPercent<=0) + if (PRI.PlayerHealth<=0 || PRI.PlayerHealthPercent<=0) C.DrawColor = C.DrawColor*0.6; Owner.CurrentStyle.DrawRectBox(0.f,YOffset,Width,Height-ScoreboardSpacing,10); Height-=ScoreboardSpacing; // Draw health bg. - if(!bShowSpectatorsOnly) + if (!bShowSpectatorsOnly) { - if(PRI.PlayerHealth<30 || PRI.PlayerHealthPercent<=0) // Chose color based on health. + if (PRI.PlayerHealth<30 || PRI.PlayerHealthPercent<=0) // Chose color based on health. C.SetDrawColor(220,32,32,255); - else if(PRI.PlayerHealth<70) + else if (PRI.PlayerHealth<70) C.SetDrawColor(220,220,32,255); else C.SetDrawColor(32,225,32,255); Owner.CurrentStyle.DrawRectBox(6.f,YOffset+6,Height-12,Height-12,5); } // Avatar - if(PRI.Avatar!=None) + if (PRI.Avatar!=None) { C.SetDrawColor(255,255,255,255); C.SetPos(Height+4,YOffset+4); @@ -392,36 +392,36 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float XPos = Height+4; // Try to obtain avatar. - if(!PRI.bBot) + if (!PRI.bBot) PRI.Avatar = FindAvatar(PRI.UniqueId); } // Name C.SetPos(XPos,YOffset+2); - if(PlayerIndex==Index) + if (PlayerIndex==Index) C.SetDrawColor(128,255,128,255); else C.DrawColor = SBTextColor; YPos = SBFontSize; S = PRI.TaggedPlayerName; - if(PRI.ShowAdminName()) + if (PRI.ShowAdminName()) { S = S$" ("$PRI.GetAdminNameAbr()$")"; C.DrawColor = PRI.GetAdminColorC(); } - else if(PRI.bIsDev) + else if (PRI.bIsDev) { S = S$" (D)"; C.DrawColor = MakeColor(130,255,235,255); } - if(bMeAdmin && PRI.FixedData>0) + if (bMeAdmin && PRI.FixedData>0) { C.DrawColor = MakeColor(255,0,0,255); S = S$" -"$PRI.GetDesc(); } - while(true) // Make sure too long name doesn't overleap. + while (true) // Make sure too long name doesn't overleap. { C.TextSize(S,XL,YL,YPos,YPos); - if((C.CurX+XL)=0) + if (PRI.RespawnCounter>=0) { C.DrawColor = SBTextColor; S = RespawnText$": "$FormatTimeSM(PRI.RespawnCounter); } - while(true) // Make sure too long name doesn't overleap. + while (true) // Make sure too long name doesn't overleap. { C.TextSize(S,XL,YL,YPos,YPos); - if((C.CurX+XL)=4) + if (Index>=4) PC.ConsoleCommand("Admin "$ExtPlayerController(PC).AdminCommands[Index-4].Cmd@RightClickPlayer.PlayerID); } } @@ -580,9 +580,9 @@ function ShowPlayerTooltip(int Index) local string S; PRI = PRIList[Index]; - if(PRI!=None) + if (PRI!=None) { - if(ToolTipItem==None) + if (ToolTipItem==None) { ToolTipItem = New(None)Class'KFGUI_Tooltip'; ToolTipItem.Owner = Owner; @@ -590,7 +590,7 @@ function ShowPlayerTooltip(int Index) ToolTipItem.InitMenu(); } S = PlayerText$": "$PRI.TaggedPlayerName$"|"$HealthText$": "$(PRI.PlayerHealthPercent<=0 ? "0" : string(PRI.PlayerHealth)); - if(PRI.ShowAdminName()) + if (PRI.ShowAdminName()) S = S$"|"$PRI.GetAdminName(); S = S$"|"$RClickForOptsText; ToolTipItem.SetText(S); @@ -603,7 +603,7 @@ function ShowPlayerTooltip(int Index) function ButtonClicked(KFGUI_Button Sender) { - switch(Sender.ID) + switch (Sender.ID) { case 'Spec': bShowSpectatorsOnly = !bShowSpectatorsOnly; diff --git a/ServerExt/Classes/UI_Scoreboard_CD.uc b/ServerExt/Classes/UI_Scoreboard_CD.uc index c4992fe..f4a1f13 100644 --- a/ServerExt/Classes/UI_Scoreboard_CD.uc +++ b/ServerExt/Classes/UI_Scoreboard_CD.uc @@ -210,7 +210,7 @@ function DrawMenu() PingXPos = Width * 0.95; // Header texts - if(!bShowSpectatorsOnly) + if (!bShowSpectatorsOnly) { Canvas.SetPos (XPos + PerkXPos, YPos); Canvas.DrawText (HeaderPerkText, , FontScalar, FontScalar); @@ -239,21 +239,21 @@ function DrawMenu() PRIList.Length = (bShowSpectatorsOnly ? NumSpec : NumPlayer); j = PRIList.Length; - for(i=(KFGRI.PRIArray.Length-1); i>=0; --i) + for (i=(KFGRI.PRIArray.Length-1); i>=0; --i) { KFPRI = ExtPlayerReplicationInfo(KFGRI.PRIArray[i]); - if(KFPRI!=None && bShowSpectatorsOnly==KFPRI.bOnlySpectator) + if (KFPRI!=None && bShowSpectatorsOnly==KFPRI.bOnlySpectator) { PRIList[--j] = KFPRI; - if(KFPRI==PC.PlayerReplicationInfo) + if (KFPRI==PC.PlayerReplicationInfo) PlayerIndex = j; } } CurrentBoxY = (YL + 4) * MaxPlayerCount; - while(CurrentBoxY > (Canvas.ClipY-YPos)) + while (CurrentBoxY > (Canvas.ClipY-YPos)) { - if(++i>=5) + if (++i>=5) { NotShownCount = MaxPlayerCount-int((Canvas.ClipY-YPos)/CurrentBoxY)+1; MaxPlayerCount-=NotShownCount; @@ -286,13 +286,13 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float if (KFPRI == GetPlayer().PlayerReplicationInfo) { - if(bFocus) + if (bFocus) C.SetDrawColor(0, 83, 255, 150); else C.SetDrawColor (51, 30, 101, 150); } else { - if(bFocus) + if (bFocus) C.SetDrawColor(0, 83, 255, 150); else C.SetDrawColor (30, 30, 30, 150); } @@ -302,10 +302,10 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float C.DrawColor = MakeColor (250, 250, 250, 255); // Perk - if(!bShowSpectatorsOnly) + if (!bShowSpectatorsOnly) { C.DrawColor = KFPRI.HUDPerkColor; - if(KFPRI.ECurrentPerk!=None) + if (KFPRI.ECurrentPerk!=None) { C.SetPos (0.f + PerkXPos, YOffset + 2.5); C.DrawRect (Height-5, Height-5, KFPRI.ECurrentPerk.Default.PerkIcon); @@ -314,7 +314,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float C.SetPos (0.f + PerkXPos + Height, YOffset); C.DrawText (S, , FontScalar, FontScalar); } - else if(KFPRI.bBot && KFPRI.CurrentPerkClass!=None) + else if (KFPRI.bBot && KFPRI.CurrentPerkClass!=None) { C.SetPos (0.f + PerkXPos, YOffset + 2.5); C.DrawRect (Height-5, Height-5, KFPRI.CurrentPerkClass.Default.PerkIcon); @@ -333,7 +333,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float } // Avatar - if(KFPRI.Avatar!=None) + if (KFPRI.Avatar!=None) { C.SetDrawColor(255,255,255,255); C.SetPos(0.f + PlayerXPos - (Height * 1.2), YOffset); @@ -342,17 +342,17 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float else { // Try to obtain avatar. - if(!KFPRI.bBot) + if (!KFPRI.bBot) KFPRI.Avatar = FindAvatar(KFPRI.UniqueId); } // Rank - if(KFPRI.ShowAdminName()) + if (KFPRI.ShowAdminName()) { S = KFPRI.GetAdminName(); C.DrawColor = KFPRI.GetAdminColorC(); } - else if(KFPRI.bIsDev) + else if (KFPRI.bIsDev) { S = DeveloperText; C.DrawColor = MakeColor(130,255,235,255); @@ -373,7 +373,7 @@ function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float C.DrawColor = MakeColor(255,255,255,255); - if(!bShowSpectatorsOnly) + if (!bShowSpectatorsOnly) { // Kill C.SetDrawColor(255,51,51,255); @@ -440,9 +440,9 @@ function ShowPlayerTooltip(int Index) local string S; PRI = PRIList[Index]; - if(PRI!=None) + if (PRI!=None) { - if(ToolTipItem==None) + if (ToolTipItem==None) { ToolTipItem = New(None)Class'KFGUI_Tooltip_CD'; ToolTipItem.Owner = Owner; @@ -450,7 +450,7 @@ function ShowPlayerTooltip(int Index) ToolTipItem.InitMenu(); } S = PlayerText$": "$PRI.TaggedPlayerName$"|"$HealthText$": "$(PRI.PlayerHealthPercent<=0 ? "0" : string(PRI.PlayerHealth)); - if(PRI.ShowAdminName()) + if (PRI.ShowAdminName()) S = S$"|"$PRI.GetAdminName(); S = S$"|"$RClickForOptsText; ToolTipItem.SetText(S); @@ -469,12 +469,12 @@ function string ConvertValueLarge(int FValue) FltValue = float(FValue); StrValue = string(FltValue); - if(FltValue < 10000.f) + if (FltValue < 10000.f) { StrValue = string(int(FltValue)); StrType = ""; } - else if(FltValue < 1000000.f) + else if (FltValue < 1000000.f) { StrValue = string(FltValue / 1000);//.0 StrType = "k"; @@ -485,7 +485,7 @@ function string ConvertValueLarge(int FValue) StrType = "m"; } i = InStr(StrValue,"."); - if(i != -1 && StrType != "") + if (i != -1 && StrType != "") return Left(StrValue,i+2) $ StrType; return StrValue; } @@ -498,7 +498,7 @@ function SelectedRCItem(int Index) PC = GetPlayer(); KFPRI = KFPlayerReplicationInfo(PC.PlayerReplicationInfo); - switch(Index) + switch (Index) { case 3: // Vote kick. KFPRI.ServerStartKickVote(RightClickPlayer, KFPRI); diff --git a/ServerExt/Classes/UI_UnloadInfo.uc b/ServerExt/Classes/UI_UnloadInfo.uc index 3814514..5e98257 100644 --- a/ServerExt/Classes/UI_UnloadInfo.uc +++ b/ServerExt/Classes/UI_UnloadInfo.uc @@ -44,7 +44,7 @@ final function SetupTo(class P) } function ButtonClicked(KFGUI_Button Sender) { - switch(Sender.ID) + switch (Sender.ID) { case 'Yes': ExtPlayerController(GetPlayer()).ServerGetUnloadInfo(0,PerkToReset,true); @@ -64,10 +64,10 @@ function CloseMenu() function ReceivedInfo(byte CallID, byte Code, int DataA, int DataB) { - if(CurCallCode!=CallID) + if (CurCallCode!=CallID) return; - switch(Code) + switch (Code) { case 0: InfoLabel.SetText(ResetDisabledWarn); diff --git a/ServerExt/Classes/VSZombie.uc b/ServerExt/Classes/VSZombie.uc index 8652a85..afa2bf5 100644 --- a/ServerExt/Classes/VSZombie.uc +++ b/ServerExt/Classes/VSZombie.uc @@ -16,7 +16,7 @@ var() bool bBoss; replication { - if(true) + if (true) ServerAttackMode; } @@ -34,8 +34,8 @@ function bool IsFiring() { local byte i; - for(i=0; i=ArrayCount(IsFiringMode) || WorldInfo.NetMode==NM_Client) + if ((bStart && bNoWeaponFiring) || Mode>=ArrayCount(IsFiringMode) || WorldInfo.NetMode==NM_Client) return; IsFiringMode[Mode] = byte(bStart); - if(bStart) + if (bStart) PlayAttackAnim(Mode); } simulated function StartFire(byte FireModeNum) { - if(bNoWeaponFiring) + if (bNoWeaponFiring) return; ServerModeFire(true,FireModeNum); } @@ -123,10 +123,10 @@ function ServerAttackAnim(byte Num) bAttacking = true; F = StartAttackAnim(Num); SetTimer(F,false,'AttackFinished'); - if(WorldInfo.NetMode!=NM_StandAlone) + if (WorldInfo.NetMode!=NM_StandAlone) { Num+=1; - if(Num==ServerAttackMode) + if (Num==ServerAttackMode) ServerAttackMode = ServerAttackMode | 128; else ServerAttackMode = Num; SetTimer(F+0.5,false,'ResetAttackTimer'); @@ -138,10 +138,10 @@ function ResetAttackTimer() } simulated event ReplicatedEvent(name VarName) { - switch(VarName) + switch (VarName) { case 'ServerAttackMode': - if(ServerAttackMode!=0) + if (ServerAttackMode!=0) { ServerAttackMode = (ServerAttackMode & 127)-1; bAttacking = true; @@ -156,7 +156,7 @@ simulated event ReplicatedEvent(name VarName) // Handle melee damage. simulated function MeleeImpactNotify(KFAnimNotify_MeleeImpact Notify) { - if(WorldInfo.NetMode!=NM_Client) + if (WorldInfo.NetMode!=NM_Client) MeleeDamageTarget(vector(Rotation)*MeleeDamage*500.f); } @@ -167,19 +167,19 @@ function bool MeleeDamageTarget(vector pushdir) local byte T; local bool bResult,bHitActors; - if(WorldInfo.NetMode==NM_Client || Controller==None) + if (WorldInfo.NetMode==NM_Client || Controller==None) Return False; // Never should be done on client. Start = GetPawnViewLocation(); - Dir = vector(GetAdjustedAimFor(None,Start)); + Dir = vector(GetAdjustedAimfor (None,Start)); T = GetTeamNum(); // First try if can hit with a small extent trace. foreach TraceActors(Class'Actor',A,HL,HN,Start+Dir*120.f,Start,vect(8,8,8)) { - if(A.bWorldGeometry || A==WorldInfo) + if (A.bWorldGeometry || A==WorldInfo) { - if(KFDoorActor(A)!=None) + if (KFDoorActor(A)!=None) { DamageDoor(KFDoorActor(A),HL,pushdir); bHitActors = true; @@ -187,9 +187,9 @@ function bool MeleeDamageTarget(vector pushdir) bResult = true; break; } - else if(Pawn(A)!=None) + else if (Pawn(A)!=None) { - if(Pawn(A).Health>0 && (Pawn(A).GetTeamNum()!=T || WorldInfo.Game.bGameEnded)) + if (Pawn(A).Health>0 && (Pawn(A).GetTeamNum()!=T || WorldInfo.Game.bGameEnded)) { DealMeleeDamage(A,HL,pushdir); bResult = true; @@ -198,7 +198,7 @@ function bool MeleeDamageTarget(vector pushdir) } } - if(!bHitActors) + if (!bHitActors) { // Then try with large extent. HN.X = GetCollisionRadius()*0.75; @@ -206,17 +206,17 @@ function bool MeleeDamageTarget(vector pushdir) HN.Z = GetCollisionHeight()*0.5; foreach TraceActors(Class'Actor',A,HL,HN,Location+Dir*120.f,Location,HN) { - if(A.bWorldGeometry || A==WorldInfo) + if (A.bWorldGeometry || A==WorldInfo) { - if(KFDoorActor(A)!=None) + if (KFDoorActor(A)!=None) DamageDoor(KFDoorActor(A),HL,pushdir); else DealMeleeDamage(A,HL,pushdir); bResult = true; break; } - else if(Pawn(A)!=None) + else if (Pawn(A)!=None) { - if(Pawn(A).Health>0 && (Pawn(A).GetTeamNum()!=T || WorldInfo.Game.bGameEnded)) + if (Pawn(A).Health>0 && (Pawn(A).GetTeamNum()!=T || WorldInfo.Game.bGameEnded)) { DealMeleeDamage(A,HL,pushdir); bResult = true; @@ -229,7 +229,7 @@ function bool MeleeDamageTarget(vector pushdir) } function DealMeleeDamage(Actor Other, vector HL, vector pushdir) { - if(KFPawn_Monster(Other)!=None && KFPawn_Monster(Other).GetTeamNum()==0) + if (KFPawn_Monster(Other)!=None && KFPawn_Monster(Other).GetTeamNum()==0) Other.TakeDamage(MeleeDamage*5, Controller, HL, pushdir, MeleeHitDT,,Self); // Almost insta-kill pet zeds. else Other.TakeDamage(MeleeDamage, Controller, HL, pushdir, MeleeHitDT,,Self); } @@ -262,10 +262,10 @@ function TakeHitZoneDamage(float Damage, class DamageType, int HitZo if (HitZoneIdx == HZI_Head) { // Based on head health, calculate number of head chunks we're allowed to remove - if(!bPlayedDeath && !bIsHeadless && !bTearOff) + if (!bPlayedDeath && !bIsHeadless && !bTearOff) { HeadHealthPercentage = GetHeadHealthPercent(); - if(HeadHealthPercentage > 0.5) + if (HeadHealthPercentage > 0.5) { MaxHeadChunkGoreWhileAlive = 1; } @@ -291,23 +291,23 @@ simulated function SetMeshVisibility(bool bVisible) simulated function DrawHUD(HUD H) { Super.DrawHUD(H); - if(Health<=0) + if (Health<=0) return; - if(!bShowFPHands) + if (!bShowFPHands) { - if(FPHandModel!=None && !FPHandModel.bHidden) + if (FPHandModel!=None && !FPHandModel.bHidden) FPHandModel.SetHidden(true); } else { - if(FPHandModel==None) + if (FPHandModel==None) { FPHandModel = Spawn(class'VSFPZedHands',Self); FPHandModel.InitHands(Mesh); FPHandModel.Mesh.SetLightingChannels(PawnLightingChannel); InitFPHands(); } - if(FPHandModel.bHidden) + if (FPHandModel.bHidden) FPHandModel.SetHidden(false); FPHandModel.SetRotation(GetViewRotation()); FPHandModel.SetLocation(GetPawnViewLocation()+(FPHandOffset >> FPHandModel.Rotation)); @@ -323,14 +323,14 @@ simulated function InitFPHands() simulated function Destroyed() { DisableNightVision(); - if(FPHandModel!=None) + if (FPHandModel!=None) FPHandModel.Destroy(); Super.Destroyed(); } simulated function PlayDying(class DamageType, vector HitLoc) { DisableNightVision(); - if(FPHandModel!=None) + if (FPHandModel!=None) FPHandModel.Destroy(); Super.PlayDying(DamageType,HitLoc); } @@ -343,10 +343,10 @@ simulated final function DisableNightVision() { local KFPlayerController KFPC; - if(IsLocallyControlled()) + if (IsLocallyControlled()) { KFPC = KFPlayerController(Controller); - if(KFPC!=None && KFPC.bNightVisionActive) + if (KFPC!=None && KFPC.bNightVisionActive) KFPC.SetNightVision(false); } } @@ -371,31 +371,31 @@ function AdjustDamage(out int InDamage, out vector Momentum, Controller Instigat // is vulnerable? DamageMod = 1.f; - if(IsVulnerableTo(DamageType,DamageMod)) + if (IsVulnerableTo(DamageType,DamageMod)) { TempDamage *= DamageMod; } - else if(IsResistantTo(DamageType,DamageMod)) + else if (IsResistantTo(DamageType,DamageMod)) { TempDamage *= DamageMod; } // Cached hit params - if(HitInfo.BoneName!='' && class(DamageType)==None && class(DamageType)==None) + if (HitInfo.BoneName!='' && class(DamageType)==None && class(DamageType)==None) { HitZoneIdx = HitZones.Find('ZoneName', HitInfo.BoneName); - if(HitZoneIdx>=0) + if (HitZoneIdx>=0) TempDamage *= HitZones[HitZoneIdx].DmgScale; } InDamage = FCeil(TempDamage); - if(InstigatedBy!=None && InstigatedBy!=Controller && InstigatedBy.GetTeamNum()==0) + if (InstigatedBy!=None && InstigatedBy!=Controller && InstigatedBy.GetTeamNum()==0) { // Give credits to pets owner. - if(Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo)!=None) + if (Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo)!=None) InstigatedBy = Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo).OwnerController; - if(InstigatedBy!=None) + if (InstigatedBy!=None) AddTakenDamage(InstigatedBy, FMin(Health, InDamage), DamageCauser, class(DamageType)); } } @@ -413,7 +413,7 @@ event Landed(vector HitNormal, actor FloorActor) function bool DoJump(bool bUpdating) { - if(bJumpCapable && (Physics == PHYS_Walking || Physics == PHYS_Ladder || Physics == PHYS_Spider)) + if (bJumpCapable && (Physics == PHYS_Walking || Physics == PHYS_Ladder || Physics == PHYS_Spider)) { if (Physics == PHYS_Spider) Velocity = Velocity + (JumpZ * Floor); diff --git a/ServerExt/Classes/VS_ZedClotBase.uc b/ServerExt/Classes/VS_ZedClotBase.uc index 5470f90..0fe4a75 100644 --- a/ServerExt/Classes/VS_ZedClotBase.uc +++ b/ServerExt/Classes/VS_ZedClotBase.uc @@ -5,7 +5,7 @@ simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp) { Super.PostInitAnimTree(SkelComp); - if(bCanHeadTrack) + if (bCanHeadTrack) { IK_Look_Head = SkelControlLookAt(Mesh.FindSkelControl('HeadLook')); //IK_Look_Spine = SkelControlLookAt(Mesh.FindSkelControl('SpineLook')); @@ -14,7 +14,7 @@ simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp) simulated function float StartAttackAnim(byte Num) // Return animation duration. { - if(FPHandModel!=None) + if (FPHandModel!=None) FPHandModel.PlayHandsAnim('Atk_Combo1_V1'); return PlayBodyAnim('Atk_Combo1_V1',EAS_UpperBody); } diff --git a/ServerExt/Classes/VS_ZedRecentZed.uc b/ServerExt/Classes/VS_ZedRecentZed.uc index 3820c0e..f7468a2 100644 --- a/ServerExt/Classes/VS_ZedRecentZed.uc +++ b/ServerExt/Classes/VS_ZedRecentZed.uc @@ -5,23 +5,23 @@ var transient float WakeUpAnimTime; replication { - if(true) + if (true) bWasWoken; } simulated function float StartAttackAnim(byte Num) // Return animation duration. { - if(FPHandModel!=None) + if (FPHandModel!=None) FPHandModel.PlayHandsAnim('Atk_Combo1_V3',1.5f); return PlayBodyAnim('Atk_Combo1_V3',EAS_UpperBody,1.5f); } simulated event ReplicatedEvent(name VarName) { - switch(VarName) + switch (VarName) { case 'bWasWoken': - if(bWasWoken) + if (bWasWoken) WakeUp(); break; default: @@ -38,16 +38,16 @@ simulated function WakeUp() // Just spawned from transformed into a zombie. } simulated function GotUp() { - if(Health<=0) + if (Health<=0) return; ClearTimer('GotUp'); bWasWoken = false; bNoWeaponFiring = false; - if(WorldInfo.NetMode!=NM_Client) + if (WorldInfo.NetMode!=NM_Client) { - if(ExtPlayerController(Controller)!=None) + if (ExtPlayerController(Controller)!=None) ExtPlayerController(Controller).EnterRagdollMode(false); - else if(Controller!=None) + else if (Controller!=None) Controller.ReplicatedEvent('EndRagdollMove'); } GoToState('Auto'); @@ -70,7 +70,7 @@ Ignores TakeDamage, FaceRotation; simulated function NotifyTeamChanged() { // Applies Character Info for < ROLE_Authority - if(PlayerReplicationInfo != None) + if (PlayerReplicationInfo != None) SetCharacterArch(GetCharacterInfo()); } @@ -91,7 +91,7 @@ simulated function SetCharacterAnimationInfo() simulated function KFCharacterInfoBase GetCharacterInfo() { - if(ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) + if (ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch(); return Super.GetCharacterInfo(); } @@ -122,9 +122,9 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor WeaponAttachmentChanged(true); } } - if(CharacterArch != none) + if (CharacterArch != none) { - if(CharacterArch.VoiceGroupArchName != "") + if (CharacterArch.VoiceGroupArchName != "") VoiceGroupArch = class(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class')); } } diff --git a/ServerExt/Classes/xUI_MapRank.uc b/ServerExt/Classes/xUI_MapRank.uc index 3f8d731..b6ff1eb 100644 --- a/ServerExt/Classes/xUI_MapRank.uc +++ b/ServerExt/Classes/xUI_MapRank.uc @@ -35,7 +35,7 @@ function CloseMenu() function ButtonClicked(KFGUI_Button Sender) { - switch(Sender.ID) + switch (Sender.ID) { case 'Yes': RepInfo.ServerRankMap(true); diff --git a/ServerExt/Classes/xUI_MapVote.uc b/ServerExt/Classes/xUI_MapVote.uc index e8458e1..c6b63b0 100644 --- a/ServerExt/Classes/xUI_MapVote.uc +++ b/ServerExt/Classes/xUI_MapVote.uc @@ -81,7 +81,7 @@ function DrawMenu() { Super.DrawMenu(); - if(RepInfo!=None && RepInfo.bListDirty) + if (RepInfo!=None && RepInfo.bListDirty) { RepInfo.bListDirty = false; UpdateList(); @@ -94,12 +94,12 @@ final function UpdateList() local float V; local KFGUI_ListItem Item,SItem; - if(GameModeCombo.Values.Length!=RepInfo.GameModes.Length) + if (GameModeCombo.Values.Length!=RepInfo.GameModes.Length) { GameModeCombo.Values.Length = RepInfo.GameModes.Length; - for(i=0; i=0 && Sel==m) + if (Sel>=0 && Sel==m) SItem = Item; } @@ -134,21 +134,21 @@ function ChangeToMaplist(KFGUI_ComboBox Sender) local int i,g; local float V; - if(RepInfo!=None) + if (RepInfo!=None) { MapList.EmptyList(); g = Sender.SelectedIndex; - for(i=0; i>16; // Grab last IP value for lookup table. - if(V<=50) + if (V<=50) V = 0; - else if(V<=100) + else if (V<=100) V = 1; - else if(V<=150) + else if (V<=150) V = 2; - else if(V<=200) + else if (V<=200) V = 3; else V = 4; // Speed up using lookup table. End = Default.EndIndex[V]; - for(i=Default.StartIndex[V]; i=Default.CT[i].S && IP<=Default.CT[i].E) // See if entered range. + if (IP>=Default.CT[i].S && IP<=Default.CT[i].E) // See if entered range. return Default.CN[Default.CT[i].C]; } return "???"; diff --git a/ServerExtMut/Classes/ExtPlayerStat.uc b/ServerExtMut/Classes/ExtPlayerStat.uc index b88d541..5cec58c 100644 --- a/ServerExtMut/Classes/ExtPlayerStat.uc +++ b/ServerExtMut/Classes/ExtPlayerStat.uc @@ -14,7 +14,7 @@ final function bool LoadStatFile(PlayerController Other) FlushData(); S = class'ServerExtMut'.Static.GetStatFile(Other.PlayerReplicationInfo.UniqueId); - if(Class'Engine'.Static.BasicLoadObject(Self,S,false,CurrentSaveVer)) + if (Class'Engine'.Static.BasicLoadObject(Self,S,false,CurrentSaveVer)) { BufferSize = Buffer.Length; return true; @@ -34,19 +34,19 @@ final function SaveStatFile(PlayerController Other) function SaveInt(int Value, optional byte MaxVal) { ++MaxVal; - if((BufferOffset+MaxVal)>Buffer.Length) + if ((BufferOffset+MaxVal)>Buffer.Length) { Buffer.Length = (BufferOffset+MaxVal); BufferSize = Buffer.Length; } Buffer[BufferOffset++] = Value & 255; - if(MaxVal>1) + if (MaxVal>1) { Buffer[BufferOffset++] = (Value >> 8) & 255; - if(MaxVal>2) + if (MaxVal>2) { Buffer[BufferOffset++] = (Value >> 16) & 255; - if(MaxVal>3) + if (MaxVal>3) Buffer[BufferOffset++] = (Value >> 24) & 255; } } @@ -56,17 +56,17 @@ function int ReadInt(optional byte MaxVal) local int Res; ++MaxVal; - if((BufferOffset+MaxVal)>BufferSize) + if ((BufferOffset+MaxVal)>BufferSize) return 0; Res = Buffer[BufferOffset++]; - if(MaxVal>1) + if (MaxVal>1) { Res = Res | (Buffer[BufferOffset++] << 8); - if(MaxVal>2) + if (MaxVal>2) { Res = Res | (Buffer[BufferOffset++] << 16); - if(MaxVal>3) + if (MaxVal>3) Res = Res | (Buffer[BufferOffset++] << 24); } } @@ -76,14 +76,14 @@ function SaveStr(string S) { local int i; - if(S=="") + if (S=="") { SaveInt(0,1); return; } S = Left(S,255); i = StrMap.Find(S); - if(i==-1) + if (i==-1) { i = StrMap.Length; StrMap[StrMap.Length] = S; @@ -95,7 +95,7 @@ function string ReadStr() local int i; i = ReadInt(1); - if(i==0 || i>StrMap.Length) + if (i==0 || i>StrMap.Length) return ""; return StrMap[i-1]; } @@ -148,7 +148,7 @@ final function DebugData() GetData(B); `Log("DEBUG DATA: Data size: "$B.Length); - for(i=0; i Res) o = 3; // write each entry. - for(i=0; i S) o = 3; // read each string map entry. - for(i=0; i V) @@ -30,15 +30,15 @@ static final function bool CheckBestTrack(PlayerReplicationInfo PRI, int Value, S = class'OnlineSubsystem'.Static.UniqueNetIdToString(PRI.UniqueId); l = class'ServerExtMut'.Default.MaxTopPlayers; - if(V.Length>l) // See if list has overflown incase an admin has changed the max stats value. + if (V.Length>l) // See if list has overflown incase an admin has changed the max stats value. V.Length = l; i = V.Find('ID',S); // First see if we have an entry from before. - if(i>=0) + if (i>=0) { - if(V[i].V==Value) // Stat unchanged. + if (V[i].V==Value) // Stat unchanged. { - if(V[i].N!=PRI.PlayerName) // Name has changed, update that. + if (V[i].N!=PRI.PlayerName) // Name has changed, update that. { V[i].N = PRI.PlayerName; return true; @@ -47,11 +47,11 @@ static final function bool CheckBestTrack(PlayerReplicationInfo PRI, int Value, } // Remove entry and insert it back in list only if rank changed. - if((i>0 && V[i-1].VValue)) + if ((i>0 && V[i-1].VValue)) V.Remove(i,1); else // No change in rank. { - if(V[i].N!=PRI.PlayerName) // Name has changed, update that. + if (V[i].N!=PRI.PlayerName) // Name has changed, update that. { V[i].N = PRI.PlayerName; return true; @@ -60,15 +60,15 @@ static final function bool CheckBestTrack(PlayerReplicationInfo PRI, int Value, } } - for(i=0; il) // See if list has overflown. + if (V.Length>l) // See if list has overflown. V.Length = l; return true; } @@ -80,22 +80,22 @@ static final function bool GetStat(ExtPlayerController PC, byte ListNum, int Sta { local UniqueNetId ID; - switch(ListNum) + switch (ListNum) { case 0: - if(StatIndex>=Default.TopPlaytimes.Length) + if (StatIndex>=Default.TopPlaytimes.Length) return false; class'OnlineSubsystem'.Static.StringToUniqueNetId(Default.TopPlaytimes[StatIndex].ID,ID); PC.ClientGetStat(ListNum,false,Default.TopPlaytimes[StatIndex].N,ID,Default.TopPlaytimes[StatIndex].V); return true; case 1: - if(StatIndex>=Default.TopKills.Length) + if (StatIndex>=Default.TopKills.Length) return false; class'OnlineSubsystem'.Static.StringToUniqueNetId(Default.TopKills[StatIndex].ID,ID); PC.ClientGetStat(ListNum,false,Default.TopKills[StatIndex].N,ID,Default.TopKills[StatIndex].V); return true; case 2: - if(StatIndex>=Default.TopExp.Length) + if (StatIndex>=Default.TopExp.Length) return false; class'OnlineSubsystem'.Static.StringToUniqueNetId(Default.TopExp[StatIndex].ID,ID); PC.ClientGetStat(ListNum,false,Default.TopExp[StatIndex].N,ID,Default.TopExp[StatIndex].V); diff --git a/ServerExtMut/Classes/ExtWebApp.uc b/ServerExtMut/Classes/ExtWebApp.uc index 206c7da..3e8aa44 100644 --- a/ServerExtMut/Classes/ExtWebApp.uc +++ b/ServerExtMut/Classes/ExtWebApp.uc @@ -10,7 +10,7 @@ function cleanup() { webadmin = None; MyMutator = None; - if(ExtAdminUI!=None) + if (ExtAdminUI!=None) { ExtAdminUI.Cleanup(); ExtAdminUI = None; @@ -39,7 +39,7 @@ final function IncludeFile(WebAdminQuery q, string file) { local string S; - if(webadmin.HTMLSubDirectory!="") + if (webadmin.HTMLSubDirectory!="") { S = webadmin.Path $ "/" $ webadmin.HTMLSubDirectory $ "/" $ file; if (q.response.FileExists(S)) @@ -80,7 +80,7 @@ final function AddConfigEditbox(WebAdminQuery q, string InfoStr, string CurVal, local string S; S = ""$InfoStr$":"; - if(!bSkipTrail) + if (!bSkipTrail) S $= ""; q.response.SendText(S); } @@ -109,7 +109,7 @@ function handleExtMod(WebAdminQuery q) local delegate SetV; local bool bEditArray; - if(ExtAdminUI==None) + if (ExtAdminUI==None) { ExtAdminUI = new (None) class'ExtWebAdmin_UI'; MyMutator.InitWebAdmin(ExtAdminUI); @@ -117,19 +117,19 @@ function handleExtMod(WebAdminQuery q) // First check if user is trying to get to another page. S = q.request.getVariable("GoToPage"); - if(S!="") + if (S!="") { - if(S=="Main Menu") + if (S=="Main Menu") EditPageIndex = -1; else EditPageIndex = ExtAdminUI.ConfigList.Find('PageName',S); } - if(EditPageIndex<0 || EditPageIndex>=ExtAdminUI.ConfigList.Length) + if (EditPageIndex<0 || EditPageIndex>=ExtAdminUI.ConfigList.Length) { // Show main links page. SendHeader(q,"Ext Server Links page"); q.response.SendText(""); - for(i=0; i"); q.response.SendText("
Links
"); } @@ -137,51 +137,51 @@ function handleExtMod(WebAdminQuery q) { S = q.request.getVariable("edit"$EditPageIndex); bEditArray = false; - if(S=="Submit") + if (S=="Submit") { // Read setting values. - for(i=0; i=0; --j) + for (j=z; j>=0; --j) { - if(q.request.getVariable("DEL"$j)=="1") + if (q.request.getVariable("DEL"$j)=="1") SetV(ExtAdminUI.ConfigList[EditPageIndex].Configs[i].PropName,j,"#DELETE"); else { S = q.request.getVariable("PR"$j,"New Line"); - if(S!="New Line") + if (S!="New Line") SetV(ExtAdminUI.ConfigList[EditPageIndex].Configs[i].PropName,j,S); } } @@ -192,29 +192,29 @@ function handleExtMod(WebAdminQuery q) SendHeader(q,ExtAdminUI.ConfigList[EditPageIndex].PageName$" ("$PathName(ExtAdminUI.ConfigList[EditPageIndex].ObjClass)$")"); q.response.SendText("
"); - if(bEditArray) + if (bEditArray) { q.response.SendText("
"); GetV = ExtAdminUI.ConfigList[EditPageIndex].GetValue; z = int(GetV(ExtAdminUI.ConfigList[EditPageIndex].Configs[i].PropName,-1)); - for(j=0; j<=z; ++j) + for (j=0; j<=z; ++j) { - if(j"); else q.response.SendText(""); break; case 2: // string AddConfigEditbox(q,"["$j$"]",S,80,"PR"$j,"",true); - if(j"); else q.response.SendText(""); break; @@ -226,9 +226,9 @@ function handleExtMod(WebAdminQuery q) else { q.response.SendText("
Edit Array "$ExtAdminUI.ConfigList[EditPageIndex].Configs[i].UIName$"Delete Line
"); - for(i=0; i"); else Logf(Intendent$"-<"$Section$">"); Intendent $= Chr(9); diff --git a/ServerExtMut/Classes/ServerExtMut.uc b/ServerExtMut/Classes/ServerExtMut.uc index d40eb53..aa931d9 100644 --- a/ServerExtMut/Classes/ServerExtMut.uc +++ b/ServerExtMut/Classes/ServerExtMut.uc @@ -85,11 +85,11 @@ function PostBeginPlay() local bool bLock; Super.PostBeginPlay(); - if(WorldInfo.Game.BaseMutator==None) + if (WorldInfo.Game.BaseMutator==None) WorldInfo.Game.BaseMutator = Self; else WorldInfo.Game.BaseMutator.AddMutator(Self); - if(bDeleteMe) // This was a duplicate instance of the mutator. + if (bDeleteMe) // This was a duplicate instance of the mutator. return; SpawnPointer = class'ExtSpawnPointHelper'.Static.FindHelper(WorldInfo); // Start init world pathlist. @@ -98,7 +98,7 @@ function PostBeginPlay() //`Log("TEST"@class'OnlineSubsystem'.Static.UniqueNetIdToString(Id)); DevNetID.Length = DevList.Length; - for(i=0; i(DynamicLoadObject(PerkClasses[i],class'Class')); - if(PK!=None) + if (PK!=None) { LoadedPerks.AddItem(PK); PK.Static.CheckConfig(); } } j = 0; - for(i=0; i0) + if (BonusGameSongs.Length>0) { BonusGameCue = SoundCue(DynamicLoadObject(BonusGameSongs[Rand(BonusGameSongs.Length)],class'SoundCue')); } - if(BonusGameFX.Length>0) + if (BonusGameFX.Length>0) { BonusGameFXObj = DynamicLoadObject(BonusGameFX[Rand(BonusGameFX.Length)],class'Object'); - if(SoundCue(BonusGameFXObj)==None && ObjectReferencer(BonusGameFXObj)==None) // Check valid type. + if (SoundCue(BonusGameFXObj)==None && ObjectReferencer(BonusGameFXObj)==None) // Check valid type. BonusGameFXObj = None; } - if(ForcedMaxPlayers>0) + if (ForcedMaxPlayers>0) { SetMaxPlayers(); SetTimer(0.001,false,'SetMaxPlayers'); } bRespawnCheck = (PlayerRespawnTime>0); - if(bRespawnCheck) + if (bRespawnCheck) SetTimer(1,true); - if(bEnableMapVote) + if (bEnableMapVote) { foreach DynamicActors(class'xVotingHandler',MV) break; - if(MV==None) + if (MV==None) MV = Spawn(class'xVotingHandler'); MV.BaseMutator = Class; } SetTimer(1,true,'CheckWave'); - if(!bNoWebAdmin && WorldInfo.NetMode!=NM_StandAlone) + if (!bNoWebAdmin && WorldInfo.NetMode!=NM_StandAlone) SetTimer(0.1,false,'SetupWebAdmin'); - if(bDumpXMLStats) + if (bDumpXMLStats) FileOutput = Spawn(class'ExtXMLOutput'); UpdateCustomZedXPArray(); @@ -270,10 +270,10 @@ function UpdateCustomZedXPArray() local CustomZedXPStruct zedxp; CustomZedXPArray.Length = 0; // Custom XP for custom zeds - for(i=0;i(DynamicLoadObject(CustomZedXP[i].zed,Class'Class')); - if(zedxp.zedclass == none) + if (zedxp.zedclass == none) { `log("Error loading"@CustomZedXP[i].zed); continue; @@ -294,9 +294,9 @@ function UpdateCustomZedXPArray() // // Disable 9mm and medpistol in all PickupFactories // foreach AllActors(class'KFPickupFactory_Item', ItemFactory) // { -// for(i=0;i(DynamicLoadObject(weapdef,class'Class')); - if(CI.WeaponDef == None) + if (CI.WeaponDef == None) return; CI.WeaponClass = class(DynamicLoadObject(CI.WeaponDef.Default.WeaponClassPath,class'Class')); - if(CI.WeaponClass == None) + if (CI.WeaponClass == None) return; CustomItemList.AddItem(CI); class'ExtPlayerReplicationInfo'.Static.SetWeaponInfo(WorldInfo.NetMode==NM_DedicatedServer,CustomTrader.SaleItems.Length,CI,CustomTrader); @@ -411,10 +411,10 @@ function AddCIToTraderEx(class weapdef) { local FCustomTraderItem CI; CI.WeaponDef = weapdef; - if(CI.WeaponDef == None) + if (CI.WeaponDef == None) return; CI.WeaponClass = class(DynamicLoadObject(CI.WeaponDef.Default.WeaponClassPath,class'Class')); - if(CI.WeaponClass == None) + if (CI.WeaponClass == None) return; CustomItemList.AddItem(CI); class'ExtPlayerReplicationInfo'.Static.SetWeaponInfo(WorldInfo.NetMode==NM_DedicatedServer,CustomTrader.SaleItems.Length,CI,CustomTrader); @@ -428,8 +428,8 @@ final function bool IsDev(const out UniqueNetId UID) { local int i; - for(i=(DevNetID.Length-1); i>=0; --i) - if(DevNetID[i]==UID) + for (i=(DevNetID.Length-1); i>=0; --i) + if (DevNetID[i]==UID) return true; return false; } @@ -440,27 +440,27 @@ function InitGRIList() KFGameReplicationInfo(WorldInfo.GRI).TraderItems = CustomTrader; // Must sync up local client. - if(WorldInfo.NetMode==NM_StandAlone) + if (WorldInfo.NetMode==NM_StandAlone) { foreach LocalPlayerControllers(class'ExtPlayerController',PC) - if(PC.PurchaseHelper!=None) + if (PC.PurchaseHelper!=None) PC.PurchaseHelper.TraderItems = CustomTrader; } } function CheckWave() { - if(KF==None) + if (KF==None) { KF = KFGameReplicationInfo(WorldInfo.GRI); - if(KF==None) + if (KF==None) return; } - if(LastWaveNum!=KF.WaveNum) + if (LastWaveNum!=KF.WaveNum) { LastWaveNum = KF.WaveNum; NotifyWaveChange(); } - if(!bGameHasEnded && KF.bMatchIsOver) // HACK, since KFGameInfo_Survival doesn't properly notify mutators of this! + if (!bGameHasEnded && KF.bMatchIsOver) // HACK, since KFGameInfo_Survival doesn't properly notify mutators of this! { SaveAllPerks(true); bGameHasEnded = true; @@ -471,20 +471,20 @@ function NotifyWaveChange() local ExtPlayerController ExtPC; local KFProj_RicochetStickBullet KFBolt; - if(bRespawnCheck) + if (bRespawnCheck) { bIsPostGame = (KF.WaveMax=0); - if(bRespawnCheck) + if (bRespawnCheck) SavePlayerInventory(); } - if(StatAutoSaveWaves>0 && ++NumWaveSwitches>=StatAutoSaveWaves) + if (StatAutoSaveWaves>0 && ++NumWaveSwitches>=StatAutoSaveWaves) { NumWaveSwitches = 0; SaveAllPerks(); } - if(!KF.bTraderIsOpen) + if (!KF.bTraderIsOpen) { foreach WorldInfo.AllControllers(class'ExtPlayerController',ExtPC) ExtPC.bSetPerk = false; @@ -492,7 +492,7 @@ function NotifyWaveChange() foreach WorldInfo.AllActors(class'KFProj_RicochetStickBullet', KFBolt) { - if(KFProj_Bolt_CompoundBowSharp(KFBolt) != none || + if (KFProj_Bolt_CompoundBowSharp(KFBolt) != none || KFProj_Bolt_Crossbow(KFBolt) != none) KFBolt.Destroy(); } @@ -506,11 +506,11 @@ function SetupWebAdmin() foreach AllActors(class'WebServer',W) break; - if(W!=None) + if (W!=None) { - for(i=0; (i<10 && A==None); ++i) + for (i=0; (i<10 && A==None); ++i) A = WebAdmin(W.ApplicationObjects[i]); - if(A!=None) + if (A!=None) { xW = new (None) class'ExtWebApp'; xW.MyMutator = Self; @@ -526,18 +526,18 @@ function SetMaxPlayers() WorldInfo.Game.MaxPlayers = ForcedMaxPlayers; WorldInfo.Game.MaxPlayersAllowed = ForcedMaxPlayers; - if(WorldInfo.Game.GameInterface!=None) + if (WorldInfo.Game.GameInterface!=None) { GameSettings = WorldInfo.Game.GameInterface.GetGameSettings(WorldInfo.Game.PlayerReplicationInfoClass.default.SessionName); - if(GameSettings!=None) + if (GameSettings!=None) GameSettings.NumPublicConnections = ForcedMaxPlayers; } } function AddMutator(Mutator M) { - if(M!=Self) // Make sure we don't get added twice. + if (M!=Self) // Make sure we don't get added twice. { - if(M.Class==Class) + if (M.Class==Class) M.Destroy(); else Super.AddMutator(M); } @@ -547,14 +547,14 @@ function bool IsFromMod(Object O) { local string PackageName; - if(O == None) + if (O == None) return false; PackageName = string(O.GetPackageName()); - if(Len(PackageName)>1 && InStr(Caps(PackageName), "KF") == 0) + if (Len(PackageName)>1 && InStr(Caps(PackageName), "KF") == 0) { PackageName = string(O); - if(Len(PackageName)>1 && InStr(Caps(PackageName), "KF") == 0) + if (Len(PackageName)>1 && InStr(Caps(PackageName), "KF") == 0) return false; } @@ -573,59 +573,59 @@ function ScoreKill(Controller Killer, Controller Killed) local KFPlayerController KFPC; local ExtPerkManager KillersPerk; - if(bRespawnCheck && Killed.bIsPlayer) + if (bRespawnCheck && Killed.bIsPlayer) CheckRespawn(Killed); KFM = KFPawn_Monster(Killed.Pawn); - if(KFM!=None && Killed.GetTeamNum()!=0 && Killer.bIsPlayer && Killer.GetTeamNum()==0) + if (KFM!=None && Killed.GetTeamNum()!=0 && Killer.bIsPlayer && Killer.GetTeamNum()==0) { - if(ExtPlayerController(Killer)!=None && ExtPlayerController(Killer).ActivePerkManager!=None) + if (ExtPlayerController(Killer)!=None && ExtPlayerController(Killer).ActivePerkManager!=None) ExtPlayerController(Killer).ActivePerkManager.PlayerKilled(KFPawn_Monster(Killed.Pawn),LastKillDamageType); - if(bKillMessages && Killer.PlayerReplicationInfo!=None) + if (bKillMessages && Killer.PlayerReplicationInfo!=None) BroadcastKillMessage(Killed.Pawn,Killer); - if(KFM.DamageHistory.Length > 0) + if (KFM.DamageHistory.Length > 0) { - for(i = 0; i damageType, vector HitLocation) { - if((KFPawn_Human(Killed)!=None && CheckPreventDeath(KFPawn_Human(Killed),Killer,damageType)) || Super.PreventDeath(Killed,Killer,damageType,HitLocation)) + if ((KFPawn_Human(Killed)!=None && CheckPreventDeath(KFPawn_Human(Killed),Killer,damageType)) || Super.PreventDeath(Killed,Killer,damageType,HitLocation)) return true; LastKillDamageType = damageType; - if(Killed.Controller!=None && KFPawn_Monster(Killed)!=None) + if (Killed.Controller!=None && KFPawn_Monster(Killed)!=None) { // Hack for when pet kills a zed. - if(Killed.GetTeamNum()!=0) + if (Killed.GetTeamNum()!=0) { - if(Killer!=None && Killer!=Killed.Controller && Killer.GetTeamNum()==0 && Ext_T_MonsterPRI(Killer.PlayerReplicationInfo)!=None) + if (Killer!=None && Killer!=Killed.Controller && Killer.GetTeamNum()==0 && Ext_T_MonsterPRI(Killer.PlayerReplicationInfo)!=None) GT_PlayerKilled(Ext_T_MonsterPRI(Killer.PlayerReplicationInfo).OwnerController,Killed.Controller,damageType); } // Broadcast pet's deathmessage. - else if(Killed.PlayerReplicationInfo!=None && PlayerController(Killed.Controller)==None && damageType!=class'KFDT_Healing') + else if (Killed.PlayerReplicationInfo!=None && PlayerController(Killed.Controller)==None && damageType!=class'KFDT_Healing') BroadcastFFDeath(Killer,Killed,damageType); } return false; @@ -695,13 +695,13 @@ final function GT_PlayerKilled(Controller Killer, Controller Killed, class=LargeMonsterHP) + if (Killed.Default.Health>=LargeMonsterHP) { foreach WorldInfo.AllControllers(class'ExtPlayerController',E) - if(!E.bClientHideKillMsg) + if (!E.bClientHideKillMsg) E.ReceiveKillMessage(Killed.Class,true,Killer.PlayerReplicationInfo); } - else if(ExtPlayerController(Killer)!=None && !ExtPlayerController(Killer).bClientHideKillMsg) + else if (ExtPlayerController(Killer)!=None && !ExtPlayerController(Killer).bClientHideKillMsg) ExtPlayerController(Killer).ReceiveKillMessage(Killed.Class); } final function BroadcastFFDeath(Controller Killer, Pawn Killed, class damageType) @@ -738,7 +738,7 @@ final function BroadcastFFDeath(Controller Killer, Pawn Killed, class0 && InstigatedBy!=None) + if (Damage>0 && InstigatedBy!=None) { - if(KFPawn_Monster(Injured)!=None) + if (KFPawn_Monster(Injured)!=None) { - if(Injured.GetTeamNum()!=0) + if (Injured.GetTeamNum()!=0) { LastDamageDealer = ExtPlayerController(InstigatedBy); - if(bDamageMessages && LastDamageDealer!=None && !LastDamageDealer.bNoDamageTracking) + if (bDamageMessages && LastDamageDealer!=None && !LastDamageDealer.bNoDamageTracking) { // Must delay this until next to get accurate damage dealt result. LastHitZed = KFPawn(Injured); @@ -788,20 +788,20 @@ function NetDamage(int OriginalDamage, out int Damage, Pawn Injured, Controller { LastDamageDealer = None; // Give credits to pet's owner. - if(Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo)!=None) + if (Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo)!=None) HackSetHistory(KFPawn(Injured),Injured,Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo).OwnerController,Damage,HitLocation); } } - else if(KFPawn(InstigatedBy.Pawn).GetTeamNum() != KFPawn(Injured).GetTeamNum()) + else if (KFPawn(InstigatedBy.Pawn).GetTeamNum() != KFPawn(Injured).GetTeamNum()) { Momentum = vect(0,0,0); Damage = 0; } } - else if(bDamageMessages && KFPawn_Human(Injured)!=None && Injured.GetTeamNum()==0 && InstigatedBy.GetTeamNum()!=0 && ExtPlayerController(InstigatedBy)!=None) + else if (bDamageMessages && KFPawn_Human(Injured)!=None && Injured.GetTeamNum()==0 && InstigatedBy.GetTeamNum()!=0 && ExtPlayerController(InstigatedBy)!=None) { LastDamageDealer = ExtPlayerController(InstigatedBy); - if(bDamageMessages && !LastDamageDealer.bClientHideNumbers) + if (bDamageMessages && !LastDamageDealer.bClientHideNumbers) { // Must delay this until next to get accurate damage dealt result. LastHitZed = KFPawn(Injured); @@ -816,14 +816,14 @@ final function CheckDamageDone() { local int Damage; - if(LastDamageDealer!=None && LastHitZed!=None && LastHitHP!=LastHitZed.Health) + if (LastDamageDealer!=None && LastHitZed!=None && LastHitHP!=LastHitZed.Health) { Damage = LastHitHP-Max(LastHitZed.Health,0); - if(Damage>0) + if (Damage>0) { - if(!LastDamageDealer.bClientHideDamageMsg && KFPawn_Monster(LastHitZed)!=None) + if (!LastDamageDealer.bClientHideDamageMsg && KFPawn_Monster(LastHitZed)!=None) LastDamageDealer.ReceiveDamageMessage(LastHitZed.Class,Damage); - if(!LastDamageDealer.bClientHideNumbers) + if (!LastDamageDealer.bClientHideNumbers) LastDamageDealer.ClientNumberMsg(Damage,LastDamagePosition,DMG_PawnDamage); } } @@ -834,18 +834,18 @@ final function HackSetHistory(KFPawn C, Pawn Injured, Controller Player, int Dam local int i; local ExtPlayerController PC; - if(Player==None) + if (Player==None) return; PC = ExtPlayerController(Player); - if(bDamageMessages && PC!=None) + if (bDamageMessages && PC!=None) { - if(!PC.bClientHideDamageMsg) + if (!PC.bClientHideDamageMsg) PC.ReceiveDamageMessage(Injured.Class,Damage); - if(!PC.bClientHideNumbers) + if (!PC.bClientHideNumbers) PC.ClientNumberMsg(Damage,HitLocation,DMG_PawnDamage); } i = C.DamageHistory.Find('DamagerController',Player); - if(i==-1) + if (i==-1) { i = C.DamageHistory.Length; C.DamageHistory.Length = i+1; @@ -854,7 +854,7 @@ final function HackSetHistory(KFPawn C, Pawn Injured, Controller Player, int Dam C.DamageHistory[i].DamagePerks.AddItem(class'ExtPerkManager'); C.DamageHistory[i].Damage = Damage; } - else if((WorldInfo.TimeSeconds-C.DamageHistory[i].LastTimeDamaged)<10) + else if ((WorldInfo.TimeSeconds-C.DamageHistory[i].LastTimeDamaged)<10) C.DamageHistory[i].Damage += Damage; else C.DamageHistory[i].Damage = Damage; @@ -864,7 +864,7 @@ final function HackSetHistory(KFPawn C, Pawn Injured, Controller Player, int Dam function bool HandleRestartGame() { - if(!bGameHasEnded) + if (!bGameHasEnded) { SaveAllPerks(true); bGameHasEnded = true; @@ -874,9 +874,9 @@ function bool HandleRestartGame() function NotifyLogout(Controller Exiting) { - if(KFPlayerController(Exiting)!=None) + if (KFPlayerController(Exiting)!=None) RemoveRespawn(Exiting); - if(!bGameHasEnded && ExtPlayerController(Exiting)!=None) + if (!bGameHasEnded && ExtPlayerController(Exiting)!=None) { CheckPerkChange(ExtPlayerController(Exiting)); SavePlayerPerk(ExtPlayerController(Exiting)); @@ -886,20 +886,20 @@ function NotifyLogout(Controller Exiting) } function NotifyLogin(Controller NewPlayer) { - if(ExtPlayerController(NewPlayer)!=None) + if (ExtPlayerController(NewPlayer)!=None) { - if(ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo)!=None) + if (ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo)!=None) InitCustomChars(ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo)); - if(bAddCountryTags && NetConnection(PlayerController(NewPlayer).Player)!=None) + if (bAddCountryTags && NetConnection(PlayerController(NewPlayer).Player)!=None) ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo).SetPlayerNameTag(class'CtryDatabase'.Static.GetClientCountryStr(PlayerController(NewPlayer).GetPlayerNetworkAddress())); ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo).bIsDev = IsDev(NewPlayer.PlayerReplicationInfo.UniqueId); - if(WorldInfo.NetMode!=NM_StandAlone) + if (WorldInfo.NetMode!=NM_StandAlone) ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo).OnRepNextItem = GetNextItem; - if(BonusGameCue!=None || BonusGameFXObj!=None) + if (BonusGameCue!=None || BonusGameFXObj!=None) ExtPlayerController(NewPlayer).ClientSetBonus(BonusGameCue,BonusGameFXObj); - if(bRespawnCheck) + if (bRespawnCheck) CheckRespawn(NewPlayer); - if(!bGameHasEnded) + if (!bGameHasEnded) InitializePerks(ExtPlayerController(NewPlayer)); SendMOTD(ExtPlayerController(NewPlayer)); } @@ -923,17 +923,17 @@ final function InitializePerks(ExtPlayerController Other) Other.OnClientGetStat = class'ExtStatList'.Static.GetStat; PM = Other.ActivePerkManager; PM.InitPerks(); - for(i=0; i0) + if (Default.MaxTopPlayers>0) class'ExtStatList'.Static.SetTopPlayers(Other); } PM.ServerInitPerks(); @@ -945,28 +945,28 @@ final function SendMOTD(ExtPlayerController PC) local int i; S = ServerMOTD; - while(Len(S)>510) + while (Len(S)>510) { PC.ReceiveServerMOTD(Left(S,500),false); S = Mid(S,500); } PC.ReceiveServerMOTD(S,true); - for(i=0; i=0; --i) - if(PlayerInv[i].OwnerPlayer==Other.Controller) + for (i=(PlayerInv.Length-1); i>=0; --i) + if (PlayerInv[i].OwnerPlayer==Other.Controller) { KFInventoryManager(Other.InvManager).bInfiniteWeight = true; KFInventoryManager(Other.InvManager).GrenadeCount = PlayerInv[i].Gren; - for(j=(PlayerInv[i].Inv.Length-1); j>=0; --j) + for (j=(PlayerInv[i].Inv.Length-1); j>=0; --j) { Inv = Other.InvManager.FindInventoryType(PlayerInv[i].Inv[j].ItemClass,false); - if(Inv==None) + if (Inv==None) { Inv = Other.InvManager.CreateInventory(PlayerInv[i].Inv[j].ItemClass); } K = KFWeapon(Inv); - if(K!=None) + if (K!=None) { K.SpareAmmoCount[0] = PlayerInv[i].Inv[j].Values[0]; K.SpareAmmoCount[1] = PlayerInv[i].Inv[j].Values[1]; @@ -1162,14 +1162,14 @@ final function bool AddPlayerSpecificInv(Pawn Other) K.ClientForceSecondaryAmmoUpdate(K.AmmoCount[1]); } } - if(Other.InvManager.FindInventoryType(class'KFInventory_Money',true)==None) + if (Other.InvManager.FindInventoryType(class'KFInventory_Money',true)==None) Other.InvManager.CreateInventory(class'KFInventory_Money'); KFInventoryManager(Other.InvManager).bInfiniteWeight = false; return true; } return false; } -final function Pawn SpawnDefaultPawnFor(Controller NewPlayer, Actor StartSpot) // Clone of GameInfo one, but with Actor StartSpot. +final function Pawn SpawnDefaultPawnfor (Controller NewPlayer, Actor StartSpot) // Clone of GameInfo one, but with Actor StartSpot. { local class PlayerClass; local Rotator R; @@ -1190,7 +1190,7 @@ final function bool RespawnPlayer(Controller NewPlayer) local SeqEvent_PlayerSpawned SpawnedEvent; local LocalPlayer LP; - if(NewPlayer.Pawn!=None) + if (NewPlayer.Pawn!=None) NewPlayer.Pawn.Destroy(); // figure out the team number and find the start spot @@ -1214,7 +1214,7 @@ final function bool RespawnPlayer(Controller NewPlayer) } // try to create a pawn to use of the default class for this player - NewPlayer.Pawn = SpawnDefaultPawnFor(NewPlayer, StartSpot); + NewPlayer.Pawn = SpawnDefaultPawnfor (NewPlayer, StartSpot); if (NewPlayer.Pawn == None) { @@ -1226,12 +1226,12 @@ final function bool RespawnPlayer(Controller NewPlayer) else { // initialize and start it up - if(NavigationPoint(startSpot)!=None) + if (NavigationPoint(startSpot)!=None) NewPlayer.Pawn.SetAnchor(NavigationPoint(startSpot)); if (PlayerController(NewPlayer) != None) { PlayerController(NewPlayer).TimeMargin = -0.1; - if(NavigationPoint(startSpot)!=None) + if (NavigationPoint(startSpot)!=None) NavigationPoint(startSpot).AnchoredPawn = None; // SetAnchor() will set this since IsHumanControlled() won't return true for the Pawn yet } NewPlayer.Pawn.LastStartSpot = PlayerStart(startSpot); @@ -1271,11 +1271,11 @@ final function bool RespawnPlayer(Controller NewPlayer) if (KFPC != none) { LP = LocalPlayer(KFPC.Player); - if(LP != None) + if (LP != None) { LP.RemoveAllPostProcessingChains(); LP.InsertPostProcessingChain(LP.Outer.GetWorldPostProcessChain(),INDEX_NONE,true); - if(KFPC.myHUD != None) + if (KFPC.myHUD != None) { KFPC.myHUD.NotifyBindPostProcessEffects(); } @@ -1284,14 +1284,14 @@ final function bool RespawnPlayer(Controller NewPlayer) KFGameInfo(WorldInfo.Game).SetTeam(NewPlayer, KFGameInfo(WorldInfo.Game).Teams[0]); - if(KFPC != none) + if (KFPC != none) { // Initialize game play post process effects such as damage, low health, etc. KFPC.InitGameplayPostProcessFX(); } - if(KFPRI!=None) + if (KFPRI!=None) { - if(KFPRI.Deaths == 0) + if (KFPRI.Deaths == 0) KFPRI.Score = KFGameInfo(WorldInfo.Game).DifficultyInfo.GetAdjustedStartingCash(); KFPRI.PlayerHealth = NewPlayer.Pawn.Health; KFPRI.PlayerHealthPercent = FloatToByte(float(NewPlayer.Pawn.Health) / float(NewPlayer.Pawn.HealthMax)); @@ -1304,49 +1304,49 @@ function PlayerBuyStats(ExtPlayerController PC, class Perk, int iS local Ext_PerkBase P; local int i; - if(bGameHasEnded) + if (bGameHasEnded) return; P = PC.ActivePerkManager.FindPerk(Perk); - if(P==None || !P.bPerkNetReady || iStat>=P.PerkStats.Length) + if (P==None || !P.bPerkNetReady || iStat>=P.PerkStats.Length) return; Amount = Min(Amount,P.PerkStats[iStat].MaxValue-P.PerkStats[iStat].CurrentValue); - if(Amount<=0) + if (Amount<=0) return; i = Amount*P.PerkStats[iStat].CostPerValue; - if(i>P.CurrentSP) + if (i>P.CurrentSP) { Amount = P.CurrentSP/P.PerkStats[iStat].CostPerValue; - if(Amount<=0) + if (Amount<=0) return; i = Amount*P.PerkStats[iStat].CostPerValue; } P.CurrentSP-=i; - if(!P.IncrementStat(iStat,Amount)) + if (!P.IncrementStat(iStat,Amount)) PC.ClientMessage("Failed to buy stat."); } function PlayerChangePerk(ExtPlayerController PC, class NewPerk) { - if(bGameHasEnded) + if (bGameHasEnded) return; - if(NewPerk==PC.ActivePerkManager.CurrentPerk.Class) + if (NewPerk==PC.ActivePerkManager.CurrentPerk.Class) { - if(PC.PendingPerkClass!=None) + if (PC.PendingPerkClass!=None) { PC.ClientMessage("You will remain the same perk now."); PC.PendingPerkClass = None; } } - else if(PC.ActivePerkManager.CurrentPerk==None || KFPawn_Customization(PC.Pawn)!=None || (!PC.bSetPerk && KFGameReplicationInfo(WorldInfo.GRI).bTraderIsOpen)) + else if (PC.ActivePerkManager.CurrentPerk==None || KFPawn_Customization(PC.Pawn)!=None || (!PC.bSetPerk && KFGameReplicationInfo(WorldInfo.GRI).bTraderIsOpen)) { - if(PC.ActivePerkManager.ApplyPerkClass(NewPerk)) + if (PC.ActivePerkManager.ApplyPerkClass(NewPerk)) { PC.ClientMessage("You have changed your perk to "$NewPerk.Default.PerkName); PC.bSetPerk = true; } else PC.ClientMessage("Invalid perk "$NewPerk.Default.PerkName); } - else if(PC.bSetPerk) + else if (PC.bSetPerk) PC.ClientMessage("Can only change perks once per wave"); else { @@ -1356,9 +1356,9 @@ function PlayerChangePerk(ExtPlayerController PC, class NewPerk) } function CheckPerkChange(ExtPlayerController PC) { - if(PC.PendingPerkClass!=None) + if (PC.PendingPerkClass!=None) { - if(PC.ActivePerkManager.ApplyPerkClass(PC.PendingPerkClass)) + if (PC.ActivePerkManager.ApplyPerkClass(PC.PendingPerkClass)) { PC.ClientMessage("You have changed your perk to "$PC.PendingPerkClass.Default.PerkName); PC.bSetPerk = true; @@ -1372,14 +1372,14 @@ function Tick(float DeltaTime) local bool bCheckedWave; local ExtPlayerController ExtPC; - if(KFGameReplicationInfo(WorldInfo.GRI).bTraderIsOpen && !bCheckedWave) + if (KFGameReplicationInfo(WorldInfo.GRI).bTraderIsOpen && !bCheckedWave) { foreach WorldInfo.AllControllers(class'ExtPlayerController',ExtPC) CheckPerkChange(ExtPC); bCheckedWave = true; } - else if(bCheckedWave) + else if (bCheckedWave) bCheckedWave = false; } function PlayerBoughtTrait(ExtPlayerController PC, class PerkClass, class Trait) @@ -1387,21 +1387,21 @@ function PlayerBoughtTrait(ExtPlayerController PC, class PerkClass local Ext_PerkBase P; local int i,cost; - if(bGameHasEnded) + if (bGameHasEnded) return; P = PC.ActivePerkManager.FindPerk(PerkClass); - if(P==None || !P.bPerkNetReady) + if (P==None || !P.bPerkNetReady) return; - for(i=0; i=Trait.Default.NumLevels) + if (P.PerkTraits[i].CurrentLevel>=Trait.Default.NumLevels) return; cost = Trait.Static.GetTraitCost(P.PerkTraits[i].CurrentLevel); - if(cost>P.CurrentSP || !Trait.Static.MeetsRequirements(P.PerkTraits[i].CurrentLevel,P)) + if (cost>P.CurrentSP || !Trait.Static.MeetsRequirements(P.PerkTraits[i].CurrentLevel,P)) return; PC.ActivePerkManager.bStatsDirty = true; @@ -1409,14 +1409,14 @@ function PlayerBoughtTrait(ExtPlayerController PC, class PerkClass P.bForceNetUpdate = true; ++P.PerkTraits[i].CurrentLevel; P.ClientReceiveTraitLvl(i,P.PerkTraits[i].CurrentLevel); - if(P.PerkTraits[i].CurrentLevel==1) - P.PerkTraits[i].Data = Trait.Static.InitializeFor(P,PC); + if (P.PerkTraits[i].CurrentLevel==1) + P.PerkTraits[i].Data = Trait.Static.Initializefor (P,PC); - if(PC.ActivePerkManager.CurrentPerk==P) + if (PC.ActivePerkManager.CurrentPerk==P) { Trait.Static.TraitDeActivate(P,P.PerkTraits[i].CurrentLevel-1,P.PerkTraits[i].Data); Trait.Static.TraitActivate(P,P.PerkTraits[i].CurrentLevel,P.PerkTraits[i].Data); - if(KFPawn_Human(PC.Pawn)!=None) + if (KFPawn_Human(PC.Pawn)!=None) { Trait.Static.CancelEffectOn(KFPawn_Human(PC.Pawn),P,P.PerkTraits[i].CurrentLevel-1,P.PerkTraits[i].Data); Trait.Static.ApplyEffectOn(KFPawn_Human(PC.Pawn),P,P.PerkTraits[i].CurrentLevel,P.PerkTraits[i].Data); @@ -1432,24 +1432,24 @@ function PlayerUnloadInfo(ExtPlayerController PC, byte CallID, class PerkClass, { local Ext_PerkBase P; - if(bGameHasEnded) + if (bGameHasEnded) return; P = PC.ActivePerkManager.FindPerk(PerkClass); - if(P==None || !P.bPerkNetReady) + if (P==None || !P.bPerkNetReady) return; - if(bPrestige) + if (bPrestige) { - if(!P.CanPrestige()) + if (!P.CanPrestige()) { PC.ClientMessage("Prestige for this perk is not allowed."); return; @@ -1502,7 +1502,7 @@ function ResetPlayerPerk(ExtPlayerController PC, class PerkClass, function bool CheckReplacement(Actor Other) { - if(bNoBoomstickJumping && KFWeap_Shotgun_DoubleBarrel(Other)!=None) + if (bNoBoomstickJumping && KFWeap_Shotgun_DoubleBarrel(Other)!=None) KFWeap_Shotgun_DoubleBarrel(Other).DoubleBarrelKickMomentum = 5.f; return true; } @@ -1521,37 +1521,37 @@ function AdminCommand(ExtPlayerController PC, int PlayerID, int Action) local ExtPlayerController E; local int i; - if(bNoAdminCommands) + if (bNoAdminCommands) { PC.ClientMessage("Admin level commands are disabled.",'Priority'); return; } - if(!HasPrivs(ExtPlayerReplicationInfo(PC.PlayerReplicationInfo))) + if (!HasPrivs(ExtPlayerReplicationInfo(PC.PlayerReplicationInfo))) { PC.ClientMessage("You do not have enough admin priveleges.",'Priority'); return; } foreach WorldInfo.AllControllers(class'ExtPlayerController',E) - if(E.PlayerReplicationInfo.PlayerID==PlayerID) + if (E.PlayerReplicationInfo.PlayerID==PlayerID) break; - if(E==None) + if (E==None) { PC.ClientMessage("Action failed, missing playerID: "$PlayerID,'Priority'); return; } - if(Action>=100) // Set perk level. + if (Action>=100) // Set perk level. { - if(E.ActivePerkManager.CurrentPerk==None) + if (E.ActivePerkManager.CurrentPerk==None) { PC.ClientMessage(E.PlayerReplicationInfo.PlayerName$" has no perk selected!!!",'Priority'); return; } - if(Action>=100000) // Set prestige level. + if (Action>=100000) // Set prestige level. { - if(E.ActivePerkManager.CurrentPerk.MinLevelForPrestige<0) + if (E.ActivePerkManager.CurrentPerk.MinLevelForPrestige<0) { PC.ClientMessage("Perk "$E.ActivePerkManager.CurrentPerk.Default.PerkName$" has prestige disabled!",'Priority'); return; @@ -1574,15 +1574,15 @@ function AdminCommand(ExtPlayerController PC, int PlayerID, int Action) return; } - switch(Action) + switch (Action) { case 0: // Reset ALL Stats - for(i=0; iWorldInfo.TimeSeconds) + if (bSpectator==PC.PlayerReplicationInfo.bOnlySpectator || PC.NextSpectateChange>WorldInfo.TimeSeconds) return; PC.NextSpectateChange = WorldInfo.TimeSeconds+0.5; - if(WorldInfo.Game.bGameEnded) + if (WorldInfo.Game.bGameEnded) PC.ClientMessage("Can't change spectate mode after end-game."); - else if(WorldInfo.Game.bWaitingToStartMatch) + else if (WorldInfo.Game.bWaitingToStartMatch) PC.ClientMessage("Can't change spectate mode before game has started."); - else if(WorldInfo.Game.AtCapacity(bSpectator,PC.PlayerReplicationInfo.UniqueId)) + else if (WorldInfo.Game.AtCapacity(bSpectator,PC.PlayerReplicationInfo.UniqueId)) PC.ClientMessage("Can't change spectate mode because game is at its maximum capacity."); - else if(bSpectator) + else if (bSpectator) { PC.NextSpectateChange = WorldInfo.TimeSeconds+2.5; - if(PC.PlayerReplicationInfo.Team!=None) + if (PC.PlayerReplicationInfo.Team!=None) PC.PlayerReplicationInfo.Team.RemoveFromTeam(PC); PC.PlayerReplicationInfo.bOnlySpectator = true; - if(PC.Pawn!=None) + if (PC.Pawn!=None) PC.Pawn.KilledBy(None); PC.Reset(); --WorldInfo.Game.NumPlayers; @@ -1681,7 +1681,7 @@ function PlayerChangeSpec(ExtPlayerController PC, bool bSpectator) else { PC.PlayerReplicationInfo.bOnlySpectator = false; - if(!WorldInfo.Game.ChangeTeam(PC,WorldInfo.Game.PickTeam(0,PC,PC.PlayerReplicationInfo.UniqueId),false)) + if (!WorldInfo.Game.ChangeTeam(PC,WorldInfo.Game.PickTeam(0,PC,PC.PlayerReplicationInfo.UniqueId),false)) { PC.PlayerReplicationInfo.bOnlySpectator = true; PC.ClientMessage("Can't become an active player, failed to set a team."); @@ -1692,14 +1692,14 @@ function PlayerChangeSpec(ExtPlayerController PC, bool bSpectator) --WorldInfo.Game.NumSpectators; PC.Reset(); WorldInfo.Game.Broadcast(PC,PC.PlayerReplicationInfo.GetHumanReadableName()@"became an active player"); - if(bRespawnCheck) + if (bRespawnCheck) CheckRespawn(PC); } } function bool GetNextItem(ExtPlayerReplicationInfo PRI, int RepIndex) { - if(RepIndex>=CustomItemList.Length) + if (RepIndex>=CustomItemList.Length) return false; PRI.ClientAddTraderItem(RepIndex,CustomItemList[RepIndex]); return true; @@ -1710,12 +1710,12 @@ function InitWebAdmin(ExtWebAdmin_UI UI) local int i; UI.AddSettingsPage("Main Server Ext",Class,WebConfigs,WebAdminGetValue,WebAdminSetValue); - for(i=0; i Ar, int Index, const out string Value) { - if(Value=="#DELETE") + if (Value=="#DELETE") Ar.Remove(Index,1); else { - if(Index>=Ar.Length) + if (Index>=Ar.Length) Ar.Length = Index+1; Ar[Index] = Value; } } function WebAdminSetValue(name PropName, int ElementIndex, string Value) { - switch(PropName) + switch (PropName) { case 'StatFileDir': StatFileDir = Value; break; diff --git a/ServerExtMut/Classes/xMapVoteHistory.uc b/ServerExtMut/Classes/xMapVoteHistory.uc index 693375e..51f8721 100644 --- a/ServerExtMut/Classes/xMapVoteHistory.uc +++ b/ServerExtMut/Classes/xMapVoteHistory.uc @@ -15,14 +15,14 @@ static final function int GetMapHistory(string MapName, string MapTitle) MapName = Caps(MapName); i = Default.M.Find(MapName); - if(i==-1) + if (i==-1) { i = Default.M.Length; Default.M.Length = i+1; Default.M[i] = MapName; Default.N.Length = i+1; } - if(!(MapTitle~=MapName) && MapTitle!=Class'WorldInfo'.Default.Title && MapTitle!="") + if (!(MapTitle~=MapName) && MapTitle!=Class'WorldInfo'.Default.Title && MapTitle!="") Default.N[i].T = MapTitle; return i; } @@ -39,9 +39,9 @@ static final function UpdateMapHistory(int iWon) { local int i; - for(i=(Default.M.Length-1); i>=0; --i) + for (i=(Default.M.Length-1); i>=0; --i) { - if(i==iWon) + if (i==iWon) { ++Default.N[i].N; Default.N[i].S = 0; @@ -51,7 +51,7 @@ static final function UpdateMapHistory(int iWon) } static final function AddMapKarma(int i, bool bUp) { - if(bUp) + if (bUp) ++Default.N[i].U; else ++Default.N[i].D; } diff --git a/ServerExtMut/Classes/xVoteBroadcast.uc b/ServerExtMut/Classes/xVoteBroadcast.uc index 74848cc..c22f6d1 100644 --- a/ServerExtMut/Classes/xVoteBroadcast.uc +++ b/ServerExtMut/Classes/xVoteBroadcast.uc @@ -10,14 +10,14 @@ function UpdateSentText() function Broadcast(Actor Sender, coerce string Msg, optional name Type) { - if((Type=='Say' || Type=='TeamSay') && Left(Msg,1)=="!" && PlayerController(Sender)!=None) + if ((Type=='Say' || Type=='TeamSay') && Left(Msg,1)=="!" && PlayerController(Sender)!=None) Handler.ParseCommand(Mid(Msg,1),PlayerController(Sender)); NextBroadcaster.Broadcast(Sender,Msg,Type); } function BroadcastTeam(Controller Sender, coerce string Msg, optional name Type) { - if((Type=='Say' || Type=='TeamSay') && Left(Msg,1)=="!" && PlayerController(Sender)!=None) + if ((Type=='Say' || Type=='TeamSay') && Left(Msg,1)=="!" && PlayerController(Sender)!=None) Handler.ParseCommand(Mid(Msg,1),PlayerController(Sender)); NextBroadcaster.BroadcastTeam(Sender,Msg,Type); } diff --git a/ServerExtMut/Classes/xVoteWebApp.uc b/ServerExtMut/Classes/xVoteWebApp.uc index 777cb93..da2ef0b 100644 --- a/ServerExtMut/Classes/xVoteWebApp.uc +++ b/ServerExtMut/Classes/xVoteWebApp.uc @@ -31,7 +31,7 @@ final function IncludeFile(WebAdminQuery q, string file) { local string S; - if(webadmin.HTMLSubDirectory!="") + if (webadmin.HTMLSubDirectory!="") { S = webadmin.Path $ "/" $ webadmin.HTMLSubDirectory $ "/" $ file; if (q.response.FileExists(S)) @@ -72,7 +72,7 @@ final function AddConfigEditbox(WebAdminQuery q, string InfoStr, string CurVal, local string S; S = ""; - if(!bNoTR) + if (!bNoTR) S = ""$S$""; q.response.SendText(S); } @@ -86,7 +86,7 @@ function handleMapVotes(WebAdminQuery q) local string S; S = q.request.getVariable("edit"); - if(S=="Submit") + if (S=="Submit") { class'xVotingHandler'.Default.VoteTime = int(q.request.getVariable("VT",string(class'xVotingHandler'.Default.VoteTime))); class'xVotingHandler'.Default.MidGameVotePct = float(q.request.getVariable("MV",string(class'xVotingHandler'.Default.MidGameVotePct))); @@ -96,7 +96,7 @@ function handleMapVotes(WebAdminQuery q) class'xVotingHandler'.Static.StaticSaveConfig(); EditSettingLine = -1; } - else if(S=="New") + else if (S=="New") { i = class'xVotingHandler'.Default.GameModes.Length; class'xVotingHandler'.Default.GameModes.Length = i+1; @@ -106,9 +106,9 @@ function handleMapVotes(WebAdminQuery q) EditSettingLine = i; class'xVotingHandler'.Static.StaticSaveConfig(); } - else if(S=="Save") + else if (S=="Save") { - if(EditSettingLine>=0 && EditSettingLine=0 && EditSettingLine
Settings
"$InfoStr$":
"); q.response.SendText(""); q.response.SendText(""); - for(i=0; i",false); AddInLineEditbox(q,class'xVotingHandler'.Default.GameModes[i].GameName,48,"GN","Game type long display name"); diff --git a/ServerExtMut/Classes/xVotingHandler.uc b/ServerExtMut/Classes/xVotingHandler.uc index 7227af5..023f263 100644 --- a/ServerExtMut/Classes/xVotingHandler.uc +++ b/ServerExtMut/Classes/xVotingHandler.uc @@ -26,21 +26,21 @@ function PostBeginPlay() local int i,j,z,n,UpV,DownV,Seq,NumPl; local string S,MapFile; - if(WorldInfo.Game.BaseMutator==None) + if (WorldInfo.Game.BaseMutator==None) WorldInfo.Game.BaseMutator = Self; else WorldInfo.Game.BaseMutator.AddMutator(Self); - if(bDeleteMe) // This was a duplicate instance of the mutator. + if (bDeleteMe) // This was a duplicate instance of the mutator. return; MapFile = string(WorldInfo.GetPackageName()); iCurrentHistory = class'xMapVoteHistory'.Static.GetMapHistory(MapFile,WorldInfo.Title); - if(LastVotedGameInfo<0 || LastVotedGameInfo>=GameModes.Length) + if (LastVotedGameInfo<0 || LastVotedGameInfo>=GameModes.Length) LastVotedGameInfo = 0; - if(MapChangeDelay==0) + if (MapChangeDelay==0) MapChangeDelay = 3; - if(GameModes.Length==0) // None specified, so use current settings. + if (GameModes.Length==0) // None specified, so use current settings. { GameModes.Length = 1; GameModes[0].GameName = "Killing Floor"; @@ -56,11 +56,11 @@ function PostBeginPlay() // Build maplist. z = 0; - for(i=(Class'KFGameInfo'.Default.GameMapCycles.Length-1); i>=0; --i) + for (i=(Class'KFGameInfo'.Default.GameMapCycles.Length-1); i>=0; --i) { - for(j=(Class'KFGameInfo'.Default.GameMapCycles[i].Maps.Length-1); j>=0; --j) + for (j=(Class'KFGameInfo'.Default.GameMapCycles[i].Maps.Length-1); j>=0; --j) { - if(MaxMapsOnList>0 && Class'KFGameInfo'.Default.GameMapCycles[i].Maps[j]~=MapFile) // If we limit the maps count, remove current map. + if (MaxMapsOnList>0 && Class'KFGameInfo'.Default.GameMapCycles[i].Maps[j]~=MapFile) // If we limit the maps count, remove current map. continue; Maps.Length = z+1; Maps[z].MapName = Class'KFGameInfo'.Default.GameMapCycles[i].Maps[j]; @@ -76,10 +76,10 @@ function PostBeginPlay() } } - if(MaxMapsOnList>0) + if (MaxMapsOnList>0) { // Remove random maps from list. - while(Maps.Length>MaxMapsOnList) + while (Maps.Length>MaxMapsOnList) Maps.Remove(Rand(Maps.Length),1); } @@ -88,9 +88,9 @@ function PostBeginPlay() } function AddMutator(Mutator M) { - if(M!=Self) // Make sure we don't get added twice. + if (M!=Self) // Make sure we don't get added twice. { - if(M.Class==Class) + if (M.Class==Class) M.Destroy(); else Super.AddMutator(M); } @@ -108,15 +108,15 @@ function SetupBroadcast() B.Handler = Self; B.NextBroadcaster = WorldInfo.Game.BroadcastHandler; WorldInfo.Game.BroadcastHandler = B; - if(!bNoWebAdmin) + if (!bNoWebAdmin) { foreach AllActors(class'WebServer',W) break; - if(W!=None) + if (W!=None) { - for(i=0; (i<10 && A==None); ++i) + for (i=0; (i<10 && A==None); ++i) A = WebAdmin(W.ApplicationObjects[i]); - if(A!=None) + if (A!=None) { xW = new (None) class'xVoteWebApp'; A.addQueryHandler(xW); @@ -130,38 +130,38 @@ final function AddVote(int Count, int MapIndex, int GameIndex) { local int i,j; - if(bMapvoteHasEnded) + if (bMapvoteHasEnded) return; - for(i=0; i=0; --j) + for (j=(ActiveVoters.Length-1); j>=0; --j) ActiveVoters[j].ClientReceiveVote(GameIndex,MapIndex,ActiveVotes[i].NumVotes); - if(ActiveVotes[i].NumVotes<=0) + if (ActiveVotes[i].NumVotes<=0) { - for(j=(ActiveVoters.Length-1); j>=0; --j) - if(ActiveVoters[j].DownloadStage==2 && ActiveVoters[j].DownloadIndex>=i && ActiveVoters[j].DownloadIndex>0) // Make sure client doesn't skip a download at this point. + for (j=(ActiveVoters.Length-1); j>=0; --j) + if (ActiveVoters[j].DownloadStage==2 && ActiveVoters[j].DownloadIndex>=i && ActiveVoters[j].DownloadIndex>0) // Make sure client doesn't skip a download at this point. --ActiveVoters[j].DownloadIndex; ActiveVotes.Remove(i,1); } return; } - if(Count<=0) + if (Count<=0) return; ActiveVotes.Length = i+1; ActiveVotes[i].GameIndex = GameIndex; ActiveVotes[i].MapIndex = MapIndex; ActiveVotes[i].NumVotes = Count; - for(j=(ActiveVoters.Length-1); j>=0; --j) + for (j=(ActiveVoters.Length-1); j>=0; --j) ActiveVoters[j].ClientReceiveVote(GameIndex,MapIndex,Count); } final function LogoutPlayer(PlayerController PC) { local int i; - for(i=(ActiveVoters.Length-1); i>=0; --i) - if(ActiveVoters[i].PlayerOwner==PC) + for (i=(ActiveVoters.Length-1); i>=0; --i) + if (ActiveVoters[i].PlayerOwner==PC) { ActiveVoters[i].Destroy(); break; @@ -172,8 +172,8 @@ final function LoginPlayer(PlayerController PC) local xVotingReplication R; local int i; - for(i=(ActiveVoters.Length-1); i>=0; --i) - if(ActiveVoters[i].PlayerOwner==PC) + for (i=(ActiveVoters.Length-1); i>=0; --i) + if (ActiveVoters[i].PlayerOwner==PC) return; R = Spawn(class'xVotingReplication',PC); R.VoteHandler = Self; @@ -182,14 +182,14 @@ final function LoginPlayer(PlayerController PC) function NotifyLogout(Controller Exiting) { - if(PlayerController(Exiting)!=None) + if (PlayerController(Exiting)!=None) LogoutPlayer(PlayerController(Exiting)); if (NextMutator != None) NextMutator.NotifyLogout(Exiting); } function NotifyLogin(Controller NewPlayer) { - if(PlayerController(NewPlayer)!=None) + if (PlayerController(NewPlayer)!=None) LoginPlayer(PlayerController(NewPlayer)); if (NextMutator != None) NextMutator.NotifyLogin(NewPlayer); @@ -197,30 +197,30 @@ function NotifyLogin(Controller NewPlayer) function ClientDownloadInfo(xVotingReplication V) { - if(bMapvoteHasEnded) + if (bMapvoteHasEnded) { V.DownloadStage = 255; return; } - switch(V.DownloadStage) + switch (V.DownloadStage) { case 0: // Game modes. - if(V.DownloadIndex>=GameModes.Length) + if (V.DownloadIndex>=GameModes.Length) break; V.ClientReceiveGame(V.DownloadIndex,GameModes[V.DownloadIndex].GameName,GameModes[V.DownloadIndex].GameShortName,GameModes[V.DownloadIndex].Prefix); ++V.DownloadIndex; return; case 1: // Maplist. - if(V.DownloadIndex>=Maps.Length) + if (V.DownloadIndex>=Maps.Length) break; - if(Maps[V.DownloadIndex].MapTitle=="") + if (Maps[V.DownloadIndex].MapTitle=="") V.ClientReceiveMap(V.DownloadIndex,Maps[V.DownloadIndex].MapName,Maps[V.DownloadIndex].UpVotes,Maps[V.DownloadIndex].DownVotes,Maps[V.DownloadIndex].Sequence,Maps[V.DownloadIndex].NumPlays); else V.ClientReceiveMap(V.DownloadIndex,Maps[V.DownloadIndex].MapName,Maps[V.DownloadIndex].UpVotes,Maps[V.DownloadIndex].DownVotes,Maps[V.DownloadIndex].Sequence,Maps[V.DownloadIndex].NumPlays,Maps[V.DownloadIndex].MapTitle); ++V.DownloadIndex; return; case 2: // Current votes. - if(V.DownloadIndex>=ActiveVotes.Length) + if (V.DownloadIndex>=ActiveVotes.Length) break; V.ClientReceiveVote(ActiveVotes[V.DownloadIndex].GameIndex,ActiveVotes[V.DownloadIndex].MapIndex,ActiveVotes[V.DownloadIndex].NumVotes); ++V.DownloadIndex; @@ -237,25 +237,25 @@ function ClientCastVote(xVotingReplication V, int GameIndex, int MapIndex, bool { local int i; - if(bMapvoteHasEnded) + if (bMapvoteHasEnded) return; - if(bAdminForce && V.PlayerOwner.PlayerReplicationInfo.bAdmin) + if (bAdminForce && V.PlayerOwner.PlayerReplicationInfo.bAdmin) { SwitchToLevel(GameIndex,MapIndex,true); return; } - if(!Class'xUI_MapVote'.Static.BelongsToPrefix(Maps[MapIndex].MapName,GameModes[GameIndex].Prefix)) + if (!Class'xUI_MapVote'.Static.BelongsToPrefix(Maps[MapIndex].MapName,GameModes[GameIndex].Prefix)) { V.PlayerOwner.ClientMessage("Error: Can't vote that map (wrong Prefix to that game mode)!"); return; } - if(V.CurrentVote[0]>=0) + if (V.CurrentVote[0]>=0) AddVote(-1,V.CurrentVote[1],V.CurrentVote[0]); V.CurrentVote[0] = GameIndex; V.CurrentVote[1] = MapIndex; AddVote(1,MapIndex,GameIndex); - for(i=(ActiveVoters.Length-1); i>=0; --i) + for (i=(ActiveVoters.Length-1); i>=0; --i) ActiveVoters[i].ClientNotifyVote(V.PlayerOwner.PlayerReplicationInfo,GameIndex,MapIndex); TallyVotes(); } @@ -266,7 +266,7 @@ function ClientRankMap(xVotingReplication V, bool bUp) function ClientDisconnect(xVotingReplication V) { ActiveVoters.RemoveItem(V); - if(V.CurrentVote[0]>=0) + if (V.CurrentVote[0]>=0) AddVote(-1,V.CurrentVote[1],V.CurrentVote[0]); TallyVotes(); } @@ -283,31 +283,31 @@ final function TallyVotes(optional bool bForce) local int i,NumVotees,c,j; local array Candidates; - if(bMapvoteHasEnded) + if (bMapvoteHasEnded) return; NumVotees = ActiveVoters.Length; c = 0; - if(bForce) + if (bForce) { // First check for highest result. - for(i=(ActiveVotes.Length-1); i>=0; --i) + for (i=(ActiveVotes.Length-1); i>=0; --i) c = Max(c,ActiveVotes[i].NumVotes); - if(c>0) + if (c>0) { // Then check how many votes for the best. - for(i=(ActiveVotes.Length-1); i>=0; --i) - if(ActiveVotes[i].NumVotes==c) + for (i=(ActiveVotes.Length-1); i>=0; --i) + if (ActiveVotes[i].NumVotes==c) Candidates.AddItem(i); // Finally pick a random winner from the best. c = Candidates[Rand(Candidates.Length)]; - if(NumVotees>=4 && ActiveVotes.Length==1) // If more then 4 voters and everyone voted same map?!!! Give the mapvote some orgy. + if (NumVotees>=4 && ActiveVotes.Length==1) // If more then 4 voters and everyone voted same map?!!! Give the mapvote some orgy. { - for(j=(ActiveVoters.Length-1); j>=0; --j) + for (j=(ActiveVoters.Length-1); j>=0; --j) ActiveVoters[j].PlayerOwner.ClientPlaySound(AnnouncerCues[13]); } SwitchToLevel(ActiveVotes[c].GameIndex,ActiveVotes[c].MapIndex,false); @@ -318,11 +318,11 @@ final function TallyVotes(optional bool bForce) c = Rand(Maps.Length); // Pick a random gametype to win along with it. - for(i=(GameModes.Length-1); i>=0; --i) - if(Class'xUI_MapVote'.Static.BelongsToPrefix(Maps[c].MapName,GameModes[i].Prefix)) + for (i=(GameModes.Length-1); i>=0; --i) + if (Class'xUI_MapVote'.Static.BelongsToPrefix(Maps[c].MapName,GameModes[i].Prefix)) Candidates.AddItem(i); - if(Candidates.Length==0) // Odd, a map without gametype... + if (Candidates.Length==0) // Odd, a map without gametype... i = Rand(GameModes.Length); else i = Candidates[Rand(Candidates.Length)]; @@ -332,14 +332,14 @@ final function TallyVotes(optional bool bForce) } // Check for insta-win vote. - for(i=(ActiveVotes.Length-1); i>=0; --i) + for (i=(ActiveVotes.Length-1); i>=0; --i) { c+=ActiveVotes[i].NumVotes; - if(GetPctOf(ActiveVotes[i].NumVotes,NumVotees)>=MapWinPct) + if (GetPctOf(ActiveVotes[i].NumVotes,NumVotees)>=MapWinPct) { - if(NumVotees>=4 && ActiveVotes.Length==1) // If more then 4 voters and everyone voted same map?!!! Give the mapvote some orgy. + if (NumVotees>=4 && ActiveVotes.Length==1) // If more then 4 voters and everyone voted same map?!!! Give the mapvote some orgy. { - for(j=(ActiveVoters.Length-1); j>=0; --j) + for (j=(ActiveVoters.Length-1); j>=0; --j) ActiveVoters[j].PlayerOwner.ClientPlaySound(AnnouncerCues[13]); } SwitchToLevel(ActiveVotes[i].GameIndex,ActiveVotes[i].MapIndex,false); @@ -348,19 +348,19 @@ final function TallyVotes(optional bool bForce) } // Check for mid-game voting timer. - if(!bMapVoteTimer && NumVotees>0 && GetPctOf(c,NumVotees)>=MidGameVotePct) + if (!bMapVoteTimer && NumVotees>0 && GetPctOf(c,NumVotees)>=MidGameVotePct) StartMidGameVote(true); } final function StartMidGameVote(bool bMidGame) { local int i; - if(bMapVoteTimer || bMapvoteHasEnded) + if (bMapVoteTimer || bMapvoteHasEnded) return; bMapVoteTimer = true; - if(bMidGame) + if (bMidGame) { - for(i=(ActiveVoters.Length-1); i>=0; --i) + for (i=(ActiveVoters.Length-1); i>=0; --i) ActiveVoters[i].ClientNotifyVoteTime(0); } ShowMenuDelay = 5; @@ -369,15 +369,15 @@ final function StartMidGameVote(bool bMidGame) } function CheckEndGameEnded() { - if(KF==None) + if (KF==None) { KF = KFGameReplicationInfo(WorldInfo.GRI); - if(KF==None) + if (KF==None) return; } - if(KF.bMatchIsOver) // HACK, since KFGameInfo_Survival doesn't properly notify mutators of this! + if (KF.bMatchIsOver) // HACK, since KFGameInfo_Survival doesn't properly notify mutators of this! { - if(!bMapVoteTimer) + if (!bMapVoteTimer) StartMidGameVote(false); ClearTimer('CheckEndGameEnded'); WorldInfo.Game.ClearTimer('ShowPostGameMenu'); @@ -385,7 +385,7 @@ function CheckEndGameEnded() } function bool HandleRestartGame() { - if(!bMapVoteTimer) + if (!bMapVoteTimer) StartMidGameVote(false); return true; } @@ -394,9 +394,9 @@ function Timer() local int i; local SoundCue FX; - if(bMapvoteHasEnded) + if (bMapvoteHasEnded) { - if(WorldInfo.NextSwitchCountdown<=0.f) // Mapswitch failed, force to random other map. + if (WorldInfo.NextSwitchCountdown<=0.f) // Mapswitch failed, force to random other map. { ActiveVotes.Length = 0; bMapvoteHasEnded = false; @@ -404,31 +404,31 @@ function Timer() } return; } - if(ShowMenuDelay>0 && --ShowMenuDelay==0) + if (ShowMenuDelay>0 && --ShowMenuDelay==0) { - for(i=(ActiveVoters.Length-1); i>=0; --i) + for (i=(ActiveVoters.Length-1); i>=0; --i) ActiveVoters[i].ClientOpenMapvote(true); } --VoteTimeLeft; - if(VoteTimeLeft==0) + if (VoteTimeLeft==0) { TallyVotes(true); } - else if(VoteTimeLeft<=10 || VoteTimeLeft==20 || VoteTimeLeft==30 || VoteTimeLeft==60) + else if (VoteTimeLeft<=10 || VoteTimeLeft==20 || VoteTimeLeft==30 || VoteTimeLeft==60) { FX = None; - if(VoteTimeLeft<=10) + if (VoteTimeLeft<=10) FX = AnnouncerCues[VoteTimeLeft-1]; - else if(VoteTimeLeft==20) + else if (VoteTimeLeft==20) FX = AnnouncerCues[10]; - else if(VoteTimeLeft==30) + else if (VoteTimeLeft==30) FX = AnnouncerCues[11]; - else if(VoteTimeLeft==60) + else if (VoteTimeLeft==60) FX = AnnouncerCues[12]; - for(i=(ActiveVoters.Length-1); i>=0; --i) + for (i=(ActiveVoters.Length-1); i>=0; --i) { ActiveVoters[i].ClientNotifyVoteTime(VoteTimeLeft); - if(FX!=None) + if (FX!=None) ActiveVoters[i].PlayerOwner.ClientPlaySound(FX); } } @@ -438,13 +438,13 @@ final function SwitchToLevel(int GameIndex, int MapIndex, bool bAdminForce) local int i; local string S; - if(bMapvoteHasEnded) + if (bMapvoteHasEnded) return; Default.LastVotedGameInfo = GameIndex; Class.Static.StaticSaveConfig(); bMapvoteHasEnded = true; - if(!bAdminForce && !bHistorySaved) + if (!bAdminForce && !bHistorySaved) { class'xMapVoteHistory'.Static.UpdateMapHistory(Maps[MapIndex].History); class'xMapVoteHistory'.Static.StaticSaveConfig(); @@ -452,21 +452,21 @@ final function SwitchToLevel(int GameIndex, int MapIndex, bool bAdminForce) } S = Maps[MapIndex].MapName$" ("$GameModes[GameIndex].GameName$")"; - for(i=(ActiveVoters.Length-1); i>=0; --i) + for (i=(ActiveVoters.Length-1); i>=0; --i) { KFPlayerController(ActiveVoters[i].PlayerOwner).ShowConnectionProgressPopup(PMT_AdminMessage,"Switching to level:",S); ActiveVoters[i].ClientNotifyVoteWin(GameIndex,MapIndex,bAdminForce); } PendingMapURL = Maps[MapIndex].MapName$"?Game="$GameModes[GameIndex].GameClass$"?Mutator="$PathName(BaseMutator); - if(GameModes[GameIndex].Mutators!="") + if (GameModes[GameIndex].Mutators!="") PendingMapURL $= ","$GameModes[GameIndex].Mutators; - if(GameModes[GameIndex].Options!="") + if (GameModes[GameIndex].Options!="") PendingMapURL $= "?"$GameModes[GameIndex].Options; `Log("MapVote: Switch map to "$PendingMapURL); SetTimer(FMax(MapChangeDelay,0.1),false,'PendingSwitch'); } -function PendingSwitch() +function Pendingswitch () { WorldInfo.ServerTravel(PendingMapURL,false); SetTimer(1,true); @@ -474,27 +474,27 @@ function PendingSwitch() final function ParseCommand(string Cmd, PlayerController PC) { - if(Cmd~="Help") + if (Cmd~="Help") { PC.ClientMessage("MapVote commands:"); PC.ClientMessage("!MapVote - Show mapvote menu"); PC.ClientMessage("!AddMap - Add map to mapvote"); PC.ClientMessage("!RemoveMap - Remove map from mapvote"); } - else if(Cmd~="MapVote") + else if (Cmd~="MapVote") ShowMapVote(PC); - else if(!PC.PlayerReplicationInfo.bAdmin && !PC.IsA('MessagingSpectator')) + else if (!PC.PlayerReplicationInfo.bAdmin && !PC.IsA('MessagingSpectator')) return; - else if(Left(Cmd,7)~="AddMap ") + else if (Left(Cmd,7)~="AddMap ") { Cmd = Mid(Cmd,7); PC.ClientMessage("Added map '"$Cmd$"'!"); AddMap(Cmd); } - else if(Left(Cmd,10)~="RemoveMap ") + else if (Left(Cmd,10)~="RemoveMap ") { Cmd = Mid(Cmd,10); - if(RemoveMap(Cmd)) + if (RemoveMap(Cmd)) PC.ClientMessage("Removed map '"$Cmd$"'!"); else PC.ClientMessage("Map '"$Cmd$"' not found!"); } @@ -503,10 +503,10 @@ function ShowMapVote(PlayerController PC) { local int i; - if(bMapvoteHasEnded) + if (bMapvoteHasEnded) return; - for(i=(ActiveVoters.Length-1); i>=0; --i) - if(ActiveVoters[i].PlayerOwner==PC) + for (i=(ActiveVoters.Length-1); i>=0; --i) + if (ActiveVoters[i].PlayerOwner==PC) { ActiveVoters[i].ClientOpenMapvote(false); return; @@ -514,7 +514,7 @@ function ShowMapVote(PlayerController PC) } final function AddMap(string M) { - if(Class'KFGameInfo'.Default.GameMapCycles.Length==0) + if (Class'KFGameInfo'.Default.GameMapCycles.Length==0) Class'KFGameInfo'.Default.GameMapCycles.Length = 1; Class'KFGameInfo'.Default.GameMapCycles[0].Maps.AddItem(M); Class'KFGameInfo'.Static.StaticSaveConfig(); @@ -523,11 +523,11 @@ final function bool RemoveMap(string M) { local int i,j; - for(i=(Class'KFGameInfo'.Default.GameMapCycles.Length-1); i>=0; --i) + for (i=(Class'KFGameInfo'.Default.GameMapCycles.Length-1); i>=0; --i) { - for(j=(Class'KFGameInfo'.Default.GameMapCycles[i].Maps.Length-1); j>=0; --j) + for (j=(Class'KFGameInfo'.Default.GameMapCycles[i].Maps.Length-1); j>=0; --j) { - if(Class'KFGameInfo'.Default.GameMapCycles[i].Maps[j]~=M) + if (Class'KFGameInfo'.Default.GameMapCycles[i].Maps[j]~=M) { Class'KFGameInfo'.Default.GameMapCycles[i].Maps.Remove(j,1); Class'KFGameInfo'.Static.StaticSaveConfig();
Mapvote game modes
Game NameGame Short NameGame ClassMutatorsOptionsMap Prefix