![]() |
reload bug
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; Code:
RBPRINT->[FUNCTION 'Reload']-[Team NONE] : I have 0 ammo. PS: I am running a dedicated linux server. |
Re: reload bug
ok, not to be bothersome, but i'd like to see if i can help squash this bug, as such i've been trying to get my head around the code and do some further debugging.
Further debugging has shown that bot_client.cpp ~ line 300 - BotClient_Valve_AmmoX function it seems to be broken index != (weapon_defs[ammo_index].iAmmo1 || weapon_defs[ammo_index].iId) i see function pointers and my brain stops processing so I don't know where to go from here. I can see where it is called in engine.cpp. It looks like it hooks into meta above this so I am lost, HTH PS. Here is the code for easy reference. Code:
// This message is sent whenever ammo ammounts are adjusted (up or down). |
Re: reload bug
its good that you pointed this out, we should investigate this further. Either the message changed; the interception of my bot does not function, or... it never worked at all ;) Lets figure it out.
|
Re: reload bug
more info...
i've been trying to find a corresponding value for the 'index' value but haven't been able to. it doesn't correspond to Code:
current_weapon.iId |
Re: reload bug
so, I collected some debug info but I was dumb and wasn't thinking exactly the best way to go about it so I just saved data each time the function was called.
the 2 'objects' i evaluated were weapon_defs[ammo_index] and bots[bot_index].current_weapon unfortunately, they are not concretely connected ???:( because ammo_index does not directly correspond to bots[bot_index].current_weapon except as bots[bot_index].current_weapon.iId i'm going off of the assumption that index is connected in some way to bots[bot_index].current_weapon and I'm just trying to find the connection. |
Re: reload bug
I have also found this is still in the source code:
Code:
if (ed) Code:
if (gpGlobals->deathmatch) |
Re: reload bug
what file is that?
|
Re: reload bug
@Whistler, i did not know it was sent 'differently'. I thought it was never sent at all! :)
(hence, thats why i have all those properties in the buy_table.ini)... thx , i'll try to get this workin ;) |
Re: reload bug
doing that change fixed the reload bug for my server
|
Re: reload bug
that message is just sent with a NULL entity so it won't get called into the "if (ed)"...
move it outside the "if(ed)" will be okay. |
All times are GMT +2. The time now is 09:54. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.