For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Issue #60. Duplicated message " has no ammo"

Report bugs, read about fixes, new features and ask questions about the Unreal 227 patch here. Place comments and commit suggestions.
Post Reply
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Issue #60. Duplicated message " has no ammo"

Post by Masterkent »

When a player tries to select a weapon with no ammo, the message " has no ammo" may be displayed twice. How to reproduce: run the game, execute "open dmDeck16" in the console, find any weapon (e.g. Minigun), waste all ammo of the taken weapon, then try to change DispersionPistol to that weapon using the corresponding slot number ("SwitchWeapon 0" for Minigun).

The reason why this happens is that the current implementation may consider the same sequence of weapons twice when trying to find an appropriate weapon that corresponds to the requested slot.

Suggested resolution:

In class Engine.Weapon, add new variable

Code: Select all

var transient bool bBreakWeaponChange;
Change function Engine.Weapon.WeaponChange as indicated below:

Code: Select all

function Weapon WeaponChange( byte F )
{
      local Weapon newWeapon;

+      if (bBreakWeaponChange)
+            return none;
+
      if ( InventoryGroup == F )
Change function Engine.PlayerPawn.SwitchWeapon as indicated below:

Code: Select all

      if ( Inventory == None )
            return;
-      if ( (Weapon != None) && (Weapon.Inventory != None) )
-            newWeapon = Weapon.Inventory.WeaponChange(F);
-      else
-            newWeapon = None;
-      if ( newWeapon == None )
-            newWeapon = Inventory.WeaponChange(F);
+
+      if (Weapon != none && Weapon.Inventory != none)
+      {
+            newWeapon = Weapon.Inventory.WeaponChange(F);
+            if (newWeapon == none)
+            {
+                  Weapon.bBreakWeaponChange = true;
+                  newWeapon = Inventory.WeaponChange(F);
+                  Weapon.bBreakWeaponChange = false;
+            }
+      }
+      else
+            newWeapon = Inventory.WeaponChange(F);
+
      if ( newWeapon == None )
            return;
[Note: modified PlayerPawn.uc and Weapon.uc will be provided as a part of 227j_39_40_appendix_2]
Last edited by Masterkent on Mon Mar 26, 2018 1:06 pm, edited 1 time in total.
Post Reply

Return to “Unreal 227”