MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / ReceiveScriptMessage

Method ReceiveScriptMessage

Source/Objects/object.cpp:349–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349void Object::ReceiveScriptMessage(const std::string &msg) {
350 receive_depth++;
351 if (receive_depth > 8) {
352 LOGW << "Deep stack on receive scripts... message: \"" << msg << "\" count: " << receive_depth << std::endl;
353 }
354 if (receive_depth > 32) {
355 LOGE << "I've gotten recursed 32 times now, assuming we're in a loop, queueing this message instead \"" << msg << "\"" << std::endl;
356 ReceiveObjectMessage(OBJECT_MSG::QUEUE_SCRIPT, &msg);
357 } else {
358 ReceiveObjectMessage(OBJECT_MSG::SCRIPT, &msg);
359 }
360 receive_depth--;
361}
362
363void Object::QueueScriptMessage(const std::string &msg) {
364 ReceiveObjectMessage(OBJECT_MSG::QUEUE_SCRIPT, &msg);

Callers 2

PlayImpactSoundMethod · 0.80
MessageMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected