File tree Expand file tree Collapse file tree 3 files changed +3
-4
lines changed
Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 55#include " LuaDB.h"
66#include " ../kcd2/IConsole.h"
77#include " ../kcd2/IGame.h"
8- #include < optional>
98#include < ranges>
109#include < sstream>
1110#include < unordered_set>
@@ -156,7 +155,7 @@ void CheckAndVacuum(SQLite::Database& db)
156155}
157156
158157// Database.cpp 优化版本
159- LuaDB::LuaDB (SSystemGlobalEnvironment* env) :
158+ LuaDB::LuaDB (const SSystemGlobalEnvironment* env) :
160159 m_db(std::make_unique<SQLite::Database>(" ./kcd2db.db" , SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE)),
161160 m_lastSaveTime(std::chrono::steady_clock::now())
162161{
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ class ScriptValue {
9494
9595class LuaDB final : public CScriptableBase, public IGameFrameworkListener {
9696public:
97- explicit LuaDB (SSystemGlobalEnvironment* env);
97+ explicit LuaDB (const SSystemGlobalEnvironment* env);
9898
9999 // Lua API
100100 int Set (IFunctionHandler* pH) { return GenericAccess (pH, AccessType::Set); }
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ void Log_init()
146146 {
147147 const auto now = std::chrono::system_clock::now ();
148148 const std::time_t t = std::chrono::system_clock::to_time_t (now);
149- std::tm tm;
149+ std::tm tm{} ;
150150 localtime_s (&tm, &t);
151151 out << " \n Log initialized at " << std::put_time (&tm, " %F %T" ) << ' \n ' ;
152152 }
You can’t perform that action at this time.
0 commit comments