| 264 | } |
| 265 | |
| 266 | void Level::Update(bool paused) { |
| 267 | ASArglist args; |
| 268 | ASArglist args2; |
| 269 | args.Add(paused ? 1 : 0); |
| 270 | std::vector<HookedASContext>::iterator cit = as_contexts_.begin(); |
| 271 | PROFILER_ENTER(g_profiler_ctx, "Level script Update()"); |
| 272 | for (auto& as_context : as_contexts_) { |
| 273 | if (as_context.ctx->CallScriptFunction(as_context.as_funcs.update, &args) == false) { |
| 274 | if (paused == false) { |
| 275 | as_context.ctx->CallScriptFunction(as_context.as_funcs.update_deprecated, &args2); |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | Online* online = Online::Instance(); |
| 281 | if (online->IsActive()) { |
| 282 | AngelScriptUpdate update; |
| 283 | if (online->GetIfPendingAngelScriptUpdates()) { |
| 284 | update = online->GetAngelScriptUpdate(); |
| 285 | |
| 286 | std::vector<char>& temp = update.data; |
| 287 | |
| 288 | bool angelscriptCallSuccesfull = false; |
| 289 | |
| 290 | for (auto& as_context : as_contexts_) { |
| 291 | if (as_context.ctx->CallMPCallBack(update.state, temp)) { |
| 292 | angelscriptCallSuccesfull = true; |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | if (angelscriptCallSuccesfull) { |
| 297 | online->MoveAngelScriptQueueForward(); |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | if (online->GetIfPendingAngelScriptStates()) { |
| 302 | update = online->GetAngelScriptStates(); |
| 303 | std::vector<char>& temp = update.data; |
| 304 | |
| 305 | bool angelscriptCallSuccesfull = false; |
| 306 | |
| 307 | for (auto& as_context : as_contexts_) { |
| 308 | if (as_context.ctx->CallMPCallBack(update.state, temp)) { |
| 309 | angelscriptCallSuccesfull = true; |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | if (angelscriptCallSuccesfull) { |
| 314 | online->MoveAngelStateQueueForward(); |
| 315 | } |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | PROFILER_LEAVE(g_profiler_ctx); |
| 320 | } |
| 321 | |
| 322 | void Level::LiveUpdateCheck() { |
| 323 | std::vector<HookedASContext>::iterator cit = as_contexts_.begin(); |
nothing calls this directly
no test coverage detected