| 753 | |
| 754 | |
| 755 | void Trigger::processTick(const Move* move) |
| 756 | { |
| 757 | Parent::processTick(move); |
| 758 | |
| 759 | if (!mDataBlock) |
| 760 | return; |
| 761 | if (mDataBlock->isClientSide && isServerObject()) |
| 762 | return; |
| 763 | if (!mDataBlock->isClientSide && isClientObject()) |
| 764 | return; |
| 765 | |
| 766 | if (isMounted()) { |
| 767 | MatrixF mat; |
| 768 | mMount.object->getMountTransform( mMount.node, mMount.xfm, &mat ); |
| 769 | setTransform(mat); |
| 770 | setRenderTransform(mat); |
| 771 | } |
| 772 | |
| 773 | // |
| 774 | if (mObjects.size() == 0) |
| 775 | return; |
| 776 | |
| 777 | if (mLastThink + mDataBlock->tickPeriodMS < mCurrTick) |
| 778 | { |
| 779 | mCurrTick = 0; |
| 780 | mLastThink = 0; |
| 781 | |
| 782 | for (S32 i = S32(mObjects.size() - 1); i >= 0; i--) |
| 783 | { |
| 784 | if (testObject(mObjects[i]) == false) |
| 785 | { |
| 786 | GameBase* remove = mObjects[i]; |
| 787 | mObjects.erase(i); |
| 788 | clearNotify(remove); |
| 789 | |
| 790 | if (evalCmD(&mLeaveCommand)) |
| 791 | { |
| 792 | String command = String("%obj = ") + remove->getIdString() + ";"; |
| 793 | command = command + String("%this = ") + getIdString() + ";" + mLeaveCommand; |
| 794 | Con::evaluate(command.c_str()); |
| 795 | } |
| 796 | if (testTrippable() && testCondition()) |
| 797 | mDataBlock->onLeaveTrigger_callback( this, remove ); |
| 798 | mTripped = true; |
| 799 | } |
| 800 | } |
| 801 | |
| 802 | if (evalCmD(&mTickCommand)) |
| 803 | Con::evaluate(mTickCommand.c_str()); |
| 804 | |
| 805 | if (mObjects.size() != 0 && testTrippable() && testCondition()) |
| 806 | mDataBlock->onTickTrigger_callback( this ); |
| 807 | } |
| 808 | else |
| 809 | { |
| 810 | mCurrTick += TickMs; |
| 811 | } |
| 812 | } |
nothing calls this directly
no test coverage detected