* Trigger the update of animation on a whole object. * @param o The object that got triggered. * @param trigger The trigger that is triggered. * @param spec The spec associated with the object. */
| 585 | * @param spec The spec associated with the object. |
| 586 | */ |
| 587 | bool TriggerObjectAnimation(Object *o, ObjectAnimationTrigger trigger, const ObjectSpec *spec) |
| 588 | { |
| 589 | if (!spec->animation.triggers.Test(trigger)) return false; |
| 590 | |
| 591 | bool ret = true; |
| 592 | uint32_t random = Random(); |
| 593 | for (TileIndex tile : o->location) { |
| 594 | if (DoTriggerObjectTileAnimation(o, tile, trigger, spec, random)) { |
| 595 | SB(random, 0, 16, Random()); |
| 596 | } else { |
| 597 | ret = false; |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | return ret; |
| 602 | } |
no test coverage detected