Update to 2.1.0
-Changed returns to continues in infinite ammo loop
-Changed g_roundwinammo player array to a simple g_roundwin switch
Quote:
Originally Posted by KyleS
Nice plugin!
There a couple odd things about it though. You're returning in your for (Which cycles through everyone) when sm_fia_adminonly is true and when the client doesn't have admin, you're also doing this if their weapon isn't a valid entity, and other places in the main loop. This stops cycling through client indexes above them. For instance if your client index 5 and I'm 6. If you have a weapon def index of 441 or 442. The loop would essentially break here and stop all further processing (Since you used return). I'm assuming you'd want to use continue instead?
|
Ahh, I misunderstood what returning did in loops. Well don't I feel stupid
. I assumed it would skip to the next index, not break the loop. I suppose I shouldve read the loop documentation more thouroughly. That would explain some of the problems I've been getting with it. Though in retrospect it makes sense since you could possibly end up with multiple conflicting return values if it did work like that. My bad, and many thanks to you for that fix.
Quote:
Originally Posted by KyleS
Nice plugin!
Just nit-picking here, but why do you have new bool:g_roundwinammo[MAXPLAYERS+1]; when it's set on everyone globally?
|
Originally for the adminonly cvar I checked admin for each client in a custom forward and switched it off for people who weren't admins. Upon review of the code I stopped being an idiot and realised a simple check in the for loop would work
. I forgot to remove the array from the roundwin global after that. Obviously it isn't needed anymore, just an oversight on my part.