Skip to content

Commit

Permalink
setTimer: Allow interval below 50ms
Browse files Browse the repository at this point in the history
  • Loading branch information
botder committed Apr 29, 2019
1 parent cef7d87 commit 5910ddf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/lua/CLuaTimer.h
Expand Up @@ -17,7 +17,7 @@ class CLuaTimer;
#include "LuaCommon.h"
#include "CLuaArguments.h"

#define LUA_TIMER_MIN_INTERVAL 50
#define LUA_TIMER_MIN_INTERVAL 0

class CLuaTimer
{
Expand Down
4 changes: 3 additions & 1 deletion Server/mods/deathmatch/logic/luadefs/CLuaTimerDefs.cpp
Expand Up @@ -68,7 +68,9 @@ int CLuaTimerDefs::SetTimer(lua_State* luaVM)
// Check for the minimum interval
if (dTimeInterval < LUA_TIMER_MIN_INTERVAL)

This comment has been minimized.

Copy link
@CrosRoad95

CrosRoad95 Apr 29, 2019

Contributor

this line should be removed, i want to make time traveling

{
argStream.SetCustomError("Interval is below 50");
char errorBuffer[64];
snprintf(errorBuffer, NUMELMS(errorBuffer), "Interval is below %d", LUA_TIMER_MIN_INTERVAL);

This comment has been minimized.

Copy link
@ccw808

ccw808 Apr 29, 2019

Member

We usually use SString constructor instead of snprintf

This comment has been minimized.

Copy link
@sbx320

sbx320 Apr 29, 2019

Member

In this case this should probably be a compile time operation anyway, as we know the value of LUA_TIMER_MIN_INTERVAL at compile time.

This comment has been minimized.

Copy link
@botder

botder Apr 30, 2019

Author Member

Fixed in 950c244

argStream.SetCustomError(errorBuffer);
}
else
{
Expand Down

4 comments on commit 5910ddf

@Einheit-101
Copy link

@Einheit-101 Einheit-101 commented on 5910ddf Apr 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

€DIT: This only works server-side, client side it still gives the "50ms" error.

@qaisjp
Copy link
Contributor

@qaisjp qaisjp commented on 5910ddf Apr 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's only a server-side change (for now?)

/cc @botder

@botder
Copy link
Member Author

@botder botder commented on 5910ddf Apr 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to make the changes in the respective client-side Lua function definitions/headers.

@botder
Copy link
Member Author

@botder botder commented on 5910ddf Apr 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 950c244

Please sign in to comment.