63 |
SendMessage(a, "shatter"); |
SendMessage(a, "shatter"); |
64 |
} |
} |
65 |
|
|
66 |
void actor_hit(const StoneContact &sc) |
void actor_hit(const StoneContact &sc) { |
67 |
{ |
Direction push_dir = get_push_direction(sc); |
68 |
ActorInfo *ai = sc.actor->get_actorinfo(); |
if (push_dir != NODIR) |
69 |
|
sc.actor->send_impulse(get_pos(), push_dir); |
|
// If the speed component towards the face of the stone is large |
|
|
// enough (and actually pointing towards the stone), consider |
|
|
// moving the stone. |
|
|
Direction dir=contact_face(sc); |
|
|
if (dir!=enigma::NODIR && ai->vel * sc.normal < -4) { |
|
|
sc.actor->send_impulse(get_pos(), reverse(dir)); |
|
|
} |
|
70 |
} |
} |
71 |
}; |
}; |
72 |
|
|