Place an object on the map at (x,y). local o = obj.new("rock"); o:placeobj(u.ux, u.uy); */
| 410 | local o = obj.new("rock"); |
| 411 | o:placeobj(u.ux, u.uy); */ |
| 412 | staticfn int |
| 413 | l_obj_placeobj(lua_State *L) |
| 414 | { |
| 415 | int argc = lua_gettop(L); |
| 416 | struct _lua_obj *lo = l_obj_check(L, 1); |
| 417 | coordxy x, y; |
| 418 | |
| 419 | if (argc != 3) |
| 420 | nhl_error(L, "l_obj_placeobj: Wrong args"); |
| 421 | |
| 422 | x = (coordxy) luaL_checkinteger(L, 2); |
| 423 | y = (coordxy) luaL_checkinteger(L, 3); |
| 424 | cvt_to_abscoord(&x, &y); |
| 425 | |
| 426 | lua_pop(L, 3); |
| 427 | |
| 428 | if (lobj_is_ok(lo)) { |
| 429 | obj_extract_self(lo->obj); |
| 430 | place_object(lo->obj, x, y); |
| 431 | newsym(x, y); |
| 432 | } |
| 433 | |
| 434 | return 0; |
| 435 | } |
| 436 | |
| 437 | RESTORE_WARNING_UNREACHABLE_CODE |
| 438 |
nothing calls this directly
no test coverage detected