| 900 | } |
| 901 | |
| 902 | void AIPlayer::followObject(SceneObject *obj, F32 radius) |
| 903 | { |
| 904 | if(!isServerObject()) |
| 905 | return; |
| 906 | |
| 907 | if ((mFollowData.lastPos - obj->getPosition()).len()<mMoveTolerance) |
| 908 | return; |
| 909 | |
| 910 | if(setPathDestination(obj->getPosition())) |
| 911 | { |
| 912 | clearCover(); |
| 913 | mFollowData.object = obj; |
| 914 | mFollowData.radius = radius; |
| 915 | mFollowData.lastPos = obj->getPosition(); |
| 916 | } |
| 917 | } |
| 918 | |
| 919 | DefineEngineMethod(AIPlayer, followObject, void, (SimObjectId obj, F32 radius),, |
| 920 | "@brief Tell the AIPlayer to follow another object.\n\n" |
no test coverage detected