MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / update

Method update

source/game/scripting/StarScriptableThread.cpp:115–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void ScriptableThread::update() {
116 float dt = m_timestep;
117
118 if (dt > 0.0f && !m_pause) {
119 for (auto& p : m_scriptContexts) {
120 p.second->update(p.second->updateDt(dt));
121 }
122 }
123
124 List<Message> messages;
125 {
126 RecursiveMutexLocker locker(m_messageMutex);
127 messages = std::move(m_messages);
128 }
129 for (auto& message : messages) {
130 if (auto resp = receiveMessage(message.message, message.args))
131 message.promise.fulfill(*resp);
132 else
133 message.promise.fail("Message not handled by thread");
134 }
135}
136
137LuaCallbacks ScriptableThread::makeThreadCallbacks() {
138 LuaCallbacks callbacks;

Callers

nothing calls this directly

Calls 3

updateDtMethod · 0.80
fulfillMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected