Ticket #3578: patch.patch

File patch.patch, 1.5 KB (added by Thomas, 9 years ago)

Patch

  • source/lib/rand.cpp

    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
    Cannot display: file marked as a binary type.
    svn:mime-type = application/octet-stream
     
    7272        x = xrand();
    7373    }
    7474    while(x >= range * inv_range);
    75     x /= inv_range;
     75    x %= range;
    7676
    7777    x += min_inclusive;
    7878    ENSURE(x < max_exclusive);
  • source/soundmanager/scripting/SoundGroup.cpp

     
    3939#include "soundmanager/items/ISoundItem.h"
    4040#include "soundmanager/SoundManager.h"
    4141
     42#include "simulation2/system/Component.h"
     43#include "simulation2/components/ICmpVisual.h"
     44
    4245#include <algorithm>
    4346
    4447
     
    203206        hSound->SetRollOff(itemRollOff);
    204207    }
    205208
     209    if (TestFlag(eRandPitch) || TestFlag(eRandGain)) {
     210        CmpPtr<ICmpVisual> cmpVisual(*g_Game->GetSimulation2(), source);
     211        if (cmpVisual)
     212            srand(cmpVisual->GetActorSeed());
     213    }
     214
    206215    if (TestFlag(eRandPitch))
    207216        hSound->SetPitch(RandFloat(m_PitchLower, m_PitchUpper));
    208217    else