ObjectRef:setpos() to move player properly (a bit shortcuttish implementation)
authorPerttu Ahola <celeron55@gmail.com>
Fri, 6 Jan 2012 17:17:44 +0000 (19:17 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Fri, 6 Jan 2012 17:17:44 +0000 (19:17 +0200)
src/scriptapi.cpp

index 8321a452971a410f4c80e2f5815e79b35fe6d7b3..b617626a0bc3a2fb05359992bd40de5719ae4f0a 100644 (file)
@@ -1747,6 +1747,10 @@ private:
                v3f pos = checkFloatPos(L, 2);
                // Do it
                co->setPos(pos);
+               // Move player if applicable
+               ServerRemotePlayer *player = getplayer(ref);
+               if(player != NULL)
+                       get_server(L)->SendMovePlayer(player);
                return 0;
        }