mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
Make Source:seek fail with negative offsets (resolves #667)
This commit is contained in:
@@ -99,6 +99,9 @@ int w_Source_seek(lua_State *L)
|
||||
{
|
||||
Source *t = luax_checksource(L, 1);
|
||||
float offset = (float)luaL_checknumber(L, 2);
|
||||
if (offset < 0)
|
||||
return luaL_error(L, "Can't seek to a negative position");
|
||||
|
||||
const char *unit = luaL_optstring(L, 3, "seconds");
|
||||
Source::Unit u;
|
||||
t->getConstant(unit, u);
|
||||
|
||||
Reference in New Issue
Block a user