start timer at location x,y */ nh.start_timer_at(x,y, "melt-ice", 10); */
| 1609 | /* start timer at location x,y */ |
| 1610 | /* nh.start_timer_at(x,y, "melt-ice", 10); */ |
| 1611 | staticfn int |
| 1612 | nhl_timer_start_at(lua_State *L) |
| 1613 | { |
| 1614 | short timertype = nhl_get_timertype(L, -2); |
| 1615 | long when = lua_tointeger(L, -1); |
| 1616 | lua_Integer lx, ly; |
| 1617 | coordxy x, y; |
| 1618 | |
| 1619 | lua_pop(L, 2); /* remove when and timertype */ |
| 1620 | if (!nhl_get_xy_params(L, &lx, &ly)) { |
| 1621 | nhl_error(L, "nhl_timer_start_at: Wrong args"); |
| 1622 | /*NOTREACHED*/ |
| 1623 | return 0; |
| 1624 | } |
| 1625 | |
| 1626 | x = (coordxy) lx; |
| 1627 | y = (coordxy) ly; |
| 1628 | cvt_to_abscoord(&x, &y); |
| 1629 | |
| 1630 | if (timer_is_pos(timertype) && isok(x, y)) { |
| 1631 | long where = ((long) x << 16) | (long) y; |
| 1632 | |
| 1633 | spot_stop_timers(x, y, timertype); |
| 1634 | (void) start_timer((long) when, TIMER_LEVEL, MELT_ICE_AWAY, |
| 1635 | long_to_any(where)); |
| 1636 | } |
| 1637 | return 0; |
| 1638 | } |
| 1639 | |
| 1640 | /* returns the visual interpretation of the key bound to an extended command, |
| 1641 | or the ext cmd name if not bound to any key */ |
nothing calls this directly
no test coverage detected