1
0

cWorld: Temporary fix for FS #338

The pickups get spawned with zero speed, not to mess up their physics simulation. Marked as temporary, remove when physics are completed.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1474 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-05-12 16:23:49 +00:00
parent 4553886d64
commit d851c47acd

View File

@ -1208,6 +1208,11 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double
float SpeedX = (float)(a_FlyAwaySpeed * (r1.randInt(1000) - 500)); float SpeedX = (float)(a_FlyAwaySpeed * (r1.randInt(1000) - 500));
float SpeedY = (float)(a_FlyAwaySpeed * r1.randInt(1000)); float SpeedY = (float)(a_FlyAwaySpeed * r1.randInt(1000));
float SpeedZ = (float)(a_FlyAwaySpeed * (r1.randInt(1000) - 500)); float SpeedZ = (float)(a_FlyAwaySpeed * (r1.randInt(1000) - 500));
// TODO 2013_05_12 _X: Because spawning pickups with nonzero speed causes them to bug (FS #338),
// I decided to temporarily reset the speed to zero to fix it, until we have proper pickup physics
SpeedX = SpeedY = SpeedZ = 0;
cPickup * Pickup = new cPickup( cPickup * Pickup = new cPickup(
(int)(a_BlockX * 32) + (r1.randInt(16) + r1.randInt(16) - 16), (int)(a_BlockX * 32) + (r1.randInt(16) + r1.randInt(16) - 16),
(int)(a_BlockY * 32) + (r1.randInt(16) + r1.randInt(16) - 16), (int)(a_BlockY * 32) + (r1.randInt(16) + r1.randInt(16) - 16),
@ -1227,6 +1232,10 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double
MTRand r1; MTRand r1;
for (cItems::const_iterator itr = a_Pickups.begin(); itr != a_Pickups.end(); ++itr) for (cItems::const_iterator itr = a_Pickups.begin(); itr != a_Pickups.end(); ++itr)
{ {
// TODO 2013_05_12 _X: Because spawning pickups with nonzero speed causes them to bug (FS #338),
// I decided to temporarily reset the speed to zero to fix it, until we have proper pickup physics
a_SpeedX = a_SpeedY = a_SpeedZ = 0;
cPickup * Pickup = new cPickup( cPickup * Pickup = new cPickup(
(int)(a_BlockX * 32) + r1.randInt(16) + r1.randInt(16), (int)(a_BlockX * 32) + r1.randInt(16) + r1.randInt(16),
(int)(a_BlockY * 32) + r1.randInt(16) + r1.randInt(16), (int)(a_BlockY * 32) + r1.randInt(16) + r1.randInt(16),