Raised This Month: $51 Target: $400
 12% 

Question About zr_infect_consecutive_block


Post New Thread Reply   
 
Thread Tools Display Modes
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 06-16-2011 , 22:37   Re: Question About zr_infect_consecutive_block
Reply With Quote #21

Do you guys have respawn enabled...
__________________
Greyscale is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 06-16-2011 , 23:15   Re: Question About zr_infect_consecutive_block
Reply With Quote #22

I do.
KyleS is offline
sp1fft
Junior Member
Join Date: Jun 2011
Old 06-16-2011 , 23:33   Re: Question About zr_infect_consecutive_block
Reply With Quote #23

I do not.
sp1fft is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 06-17-2011 , 07:09   Re: Question About zr_infect_consecutive_block
Reply With Quote #24

Tested again with bot_quota set to 5 and 6. Still got some double infections (either me or some bots). Respawning was off.

Enabling disabling SourceTV had no effect, so that one isn't disrupting anything.

I also had zr_infect_spawntime_min set to 1 and the max set to 2 to get quick rounds. Ratio was 2, 3 or 4. Once mother zombies were infected I remembered the names and ended the round with the zr_infect @all command.

I tested for 40-50 rounds on my linux test server with the latest patch (r649).

Whether it's on windows or linux shouldn't matter, neither which random number generator that's used. Our code should prevent it, but it doesn't and I can't see why. I guess we could print a message to the chat in every event the flag is modified and dump data; event, client, type, data.

Update:
It turns out that the immunity flag is reset on every infect that isn't a mother zombie infect. So if all players do nothing and let the round end, it works. But as soon as someone infect a human, the human's immunity flag is reset. This also applies to the admin infect command.

It's a case in this logic when the immunity flag is supposed to be kept as it is (not changed). That is when a zombie infect a human, and when a admin infect command is used. We use the ternary operator to update the flag, but that won't work in this case.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 06-17-2011 at 07:53.
rhelgeby is offline
Send a message via MSN to rhelgeby
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 06-17-2011 , 07:55   Re: Question About zr_infect_consecutive_block
Reply With Quote #25

Good to hear you were able to narrow it down.

Another issue related to infections is that sometimes the same players are infected every other round. This is due to GetRandomInt not being very "random". I did a quick find/replace with this stock from smlib and that solved the problem.

Code:
#define SIZE_OF_INT  2147483647      // without 0 /**  * Returns a random, uniform Integer number in the specified (inclusive) range.  * This is safe to use multiple times in a function.  * The seed is set automatically for each plugin.  * Rewritten by MatthiasVance, thanks.  *  * @param min         Min value used as lower border  * @param max         Max value used as upper border  * @return        Random Integer number between min and max  */ stock Math_GetRandomInt(min, max) {     new random = GetURandomInt();         if (random == 0) {         random++;     }     return RoundToCeil(float(random) / (float(SIZE_OF_INT) / float(max - min + 1))) + min - 1; }

Last edited by GoD-Tony; 06-17-2011 at 07:58.
GoD-Tony is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 06-17-2011 , 09:08   Re: Question About zr_infect_consecutive_block
Reply With Quote #26

Thanks for the tip. This one is much better.

See the latest patch for bug fixes: http://forums.alliedmods.net/showthread.php?t=111492
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
-=Leb=-
SourceMod Donor
Join Date: Dec 2008
Location: Sweden/Stockholm
Old 06-17-2011 , 09:57   Re: Question About zr_infect_consecutive_block
Reply With Quote #27

thank you gentlemen for taking your time to resolve the bug. Much respect.

Tusen Tack ;)
-=Leb=- is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 06-17-2011 , 15:00   Re: Question About zr_infect_consecutive_block
Reply With Quote #28

Quote:
Originally Posted by rhelgeby View Post
See the latest patch for bug fixes: http://forums.alliedmods.net/showthread.php?t=111492
I'll get the new version running, thanks!

Quote:
Originally Posted by -=Leb=- View Post
Tusen Tack ;)
I thought only Danes said this.
GoD-Tony is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 06-17-2011 , 23:14   Re: Question About zr_infect_consecutive_block
Reply With Quote #29

I asked about respawn because I figured out that if someone is infected again as a reg zombie, the mother flag will reset. So you ending the round with zr_infect @all reset all the flags. Though I don't know why it wasn't skipping clients that were already zombies.. I was doing mp_restartgame 1. Well anyway, problem solved.
__________________
Greyscale is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 06-18-2011 , 06:54   Re: Question About zr_infect_consecutive_block
Reply With Quote #30

Nice job!
KyleS is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode