Thread: reload bug
View Single Post
reload bug
Old
  (#1)
Josh_Borke
Member
 
Status: Offline
Posts: 152
Join Date: Jun 2004
Default reload bug - 24-06-2004

Steps to reproduce bug:
Using the current WIP, if you load de_dust2 with approx 6 bots, on the first round they usually all run to the middle hill and start battling it out. Inevitably some/all of the bots will run out of ammo and then proceed to look at each other trying to figure out what to do. Pretty funny if you let them knife once they get close enough

Extra info:
I've been trying to see if I could fix this by putting in a check of how much ammo they have in cbot::FireWeapon() around line 963.
It successfully see that its clip is empty, but a check of it's remaining ammo returns 0.

Code:
   		int iTotalAmmo = current_weapon.iAmmo1;
   		int iCurrentAmmo = current_weapon.iClip;
   
   		if (iCurrentAmmo < 1 && (CarryWeaponType() == SECONDARY 
  			  || CarryWeaponType() == PRIMARY))
   		{
   				char msg[80];
   			    sprintf(msg,"I have %d ammo.",iTotalAmmo);
 				REALBOT_PRINT(NULL,"Reload",msg);
   				if (iTotalAmmo > 0) {
 					 REALBOT_PRINT(NULL,"Reload","I went to reload.");
 					 UTIL_BotPressKey (this, IN_RELOAD);
   				}
   				else {
 					 PickBestWeapon();
   				}
   		}
The reallog.txt returns
Code:
   RBPRINT->[FUNCTION 'Reload']-[Team NONE] : I have 0 ammo.
HTH

PS: I am running a dedicated linux server.

Last edited by Josh_Borke; 24-06-2004 at 17:38..
  
Reply With Quote