UFO:Alien Invasion

Archive => Bugs prior to release 2.4 => Topic started by: dodon on July 17, 2010, 10:26:36 pm

Title: random map assembly not random
Post by: dodon on July 17, 2010, 10:26:36 pm
if the cvar "sv_threads" is not 0 (default since r03484) the layout of RMAs is always the same.

examples from ufoconsole.log:
Code: [Select]
2010/07/17 21:53:15 CM_LoadMap: "-africa/af_ +craft_ufo_scout +craft_drop_firebird +empty1 +empty2 +house1 +house2 +house3 +house4 +house5 +fence3 +misc1 +fence1 +misc1 +misc1" "0 -8 0 -24 -16 0 -24 8 0 16 8 0 16 0 0 -8 0 0 8 8 0 0 -16 0 -8 8 0 -16 8 0 -8 -8 0 -8 -16 0 16 -8 0 16 -16 0"
2010/07/17 21:53:42 CM_LoadMap: "-africa/af_ +craft_ufo_scout +craft_drop_firebird +empty1 +empty2 +house1 +house2 +house3 +house4 +house5 +fence3 +misc1 +fence1 +misc1 +misc1" "0 -8 0 -24 -16 0 -24 8 0 16 8 0 16 0 0 -8 0 0 8 8 0 0 -16 0 -8 8 0 -16 8 0 -8 -8 0 -8 -16 0 16 -8 0 16 -16 0"
2010/07/17 21:56:10 CM_LoadMap: "-africa/af_ +craft_ufo_scout +craft_drop_firebird +empty1 +empty2 +house1 +house2 +house3 +house4 +house5 +fence3 +misc1 +fence1 +misc1 +misc1" "0 -8 0 -24 -16 0 -24 8 0 16 8 0 16 0 0 -8 0 0 8 8 0 0 -16 0 -8 8 0 -16 8 0 -8 -8 0 -8 -16 0 16 -8 0 16 -16 0"

The reason for this behaviour is, that the threads, that create the maps always use the same sequence of random numbers due to a missing "srand" command.

I atached a quickfix for this problem.
It's a quickfix, because ...

 



Title: Re: random map assembly not random
Post by: Duke on July 19, 2010, 12:21:55 am
Ouch. I guess you found something important.
Stay tuned.