MCPcopy Create free account
hub / github.com/crawl/crawl / notify_dgn_event

Method notify_dgn_event

crawl-ref/source/mapmark.cc:359–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359bool map_lua_marker::notify_dgn_event(const dgn_event &e)
360{
361 lua_stack_cleaner clean(dlua);
362 push_fn_args("event");
363 clua_push_dgn_event(dlua, &e);
364 if (!dlua.callfn("dlua_marker_method", 4, 1))
365 {
366 mprf(MSGCH_ERROR, "notify_dgn_event: Lua error: %s",
367 dlua.error.c_str());
368
369 // Lua error prevents veto if the event is vetoable.
370 return true;
371 }
372
373 bool accepted = true;
374
375 // We accept only a real boolean false as a veto.
376 if (lua_isboolean(dlua, -1))
377 accepted = lua_toboolean(dlua, -1);
378
379 return accepted;
380}
381
382string map_lua_marker::call_str_fn(const char *fn) const
383{

Callers 3

fire_position_eventMethod · 0.80
fire_eventMethod · 0.80

Calls 3

clua_push_dgn_eventFunction · 0.85
mprfFunction · 0.85
callfnMethod · 0.45

Tested by

no test coverage detected