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

Function ASDoesItemFitInItem

Source/Scripting/angelscript/asfuncs.cpp:3212–3226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3210#include "Objects/itemobject.h"
3211
3212bool ASDoesItemFitInItem(int a, int b) {
3213 Object* obj_a = the_scenegraph->GetObjectFromID(a);
3214 Object* obj_b = the_scenegraph->GetObjectFromID(b);
3215 if (!obj_a || obj_a->GetType() != _item_object) {
3216 std::string callstack = active_context_stack.top()->GetCallstack();
3217 FatalError("Error", "There is no item object %d.\n Called from:\n%s", a, callstack.c_str());
3218 };
3219 if (!obj_b || obj_b->GetType() != _item_object) {
3220 std::string callstack = active_context_stack.top()->GetCallstack();
3221 FatalError("Error", "There is no item object %d.\n Called from:\n%s", b, callstack.c_str());
3222 }
3223 ItemObject* item_obj_a = (ItemObject*)obj_a;
3224 ItemObject* item_obj_b = (ItemObject*)obj_b;
3225 return item_obj_b->item_ref()->GetContains() == item_obj_a->item_ref()->path_;
3226}
3227
3228float ASGetFriction(const vec3& pos) {
3229 return the_scenegraph->GetMaterialFriction(pos);

Callers

nothing calls this directly

Calls 6

GetObjectFromIDMethod · 0.80
GetCallstackMethod · 0.80
topMethod · 0.80
FatalErrorFunction · 0.50
GetTypeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected