MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / FindShape

Function FindShape

engine/Poseidon/UI/OptionsUI.cpp:632–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630RString FindScript(RString name)
631{
632 // find in mission
633 RString fullname = GetMissionDirectory() + name;
634 if (QIFStreamB::FileExist(fullname))
635 {
636 return fullname;
637 }
638
639 // find in campaign
640 fullname = BaseDirectory + RString("scripts\\") + name;
641 if (QIFStreamB::FileExist(fullname))
642 {
643 return fullname;
644 }
645
646 // find in root
647 fullname = RString("scripts\\") + name;
648 if (QIFStreamB::FileExist(fullname))
649 {
650 return fullname;
651 }
652
653 Poseidon::Foundation::WarningMessage("Script %s not found", (const char*)name);
654 return "";
655}
656
657RString FindShape(RString name)
658{
659 // ignore @ - not used now
660 if (name[0] == '@')
661 {
662 name = (const char*)name + 1;
663 }
664
665 // find in mission
666 RString fullname = GetMissionDirectory() + name;
667 if (QIFStreamB::FileExist(fullname))
668 {
669 return fullname;
670 }
671
672 // find in campaign
673 fullname = BaseDirectory + RString("dtaExt\\") + name;

Callers 5

LoadMethod · 0.85
CHeadMethod · 0.85
ControlObjectMethod · 0.85
InitMethod · 0.85

Calls 4

GetMissionDirectoryFunction · 0.85
GetShapeNameFunction · 0.85
WarningMessageFunction · 0.85
RStringClass · 0.50

Tested by

no test coverage detected