Skip to content
Permalink
Browse files

Fix #2060: Cross check checks OCF of colliding object again

In the PR I removed the check, because I thought that it was already
ensured by "ball->OCF & ball_required_ocf". This caused the following
issue:
If you run into a OCF_Carryable object with at speed > OCF_HitSpeed2,
then you "fling yourself".

Will improve the code structure after this commit.
  • Loading branch information...
gitMarky committed Apr 6, 2019
1 parent e8cacb3 commit 586c93931abb8e4d3131be47070a100d881bfb11
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/object/C4GameObjects.cpp
@@ -139,7 +139,7 @@ void C4GameObjects::CrossCheck() // Every Tick1 by ExecObjects
C4Real relative_ydir = ball->ydir - goal->ydir;
C4Real hit_speed = relative_xdir * relative_xdir + relative_ydir * relative_ydir;
// Only hit if <ball>'s speed and relative speeds are larger than HitSpeed2
if ((hit_speed > HitSpeed2) && !goal->Call(PSF_QueryCatchBlow, &C4AulParSet(ball)))
if ((ball->OCF & OCF_HitSpeed2) && (hit_speed > HitSpeed2) && !goal->Call(PSF_QueryCatchBlow, &C4AulParSet(ball)))
{
int32_t hit_energy = fixtoi(hit_speed * ball->Mass / 5);
// Hit energy reduced to 1/3rd, but do not drop to zero because of this division.

0 comments on commit 586c939

Please sign in to comment.
You can’t perform that action at this time.