diff --git a/src/lua_waypointslib.c b/src/lua_waypointslib.c
index b65cb767b8c03b9bef962fd1b2180e552e90ab3d..5f3b25085163af11cf7cb4e7bf6d439fd4373f96 100644
--- a/src/lua_waypointslib.c
+++ b/src/lua_waypointslib.c
@@ -131,11 +131,9 @@ static int waypoint_set(lua_State *L)
 	switch (field)
 	{
 		case waypointvars_mobj:
-			waypoint->mobj = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
-			break;
+			return RNOSET;
 		case waypointvars_onaline:
-			waypoint->onaline = luaL_checkboolean(L, 3);
-			break;
+			return RNOSET;
 		// A function should be used to set these instead.
 		case waypointvars_nextwaypoints:
 			return RNOSET;