Posted: 08 Oct 2007, 18:29
At the time I had a working debugger which threw up all manner of errors that I could never have explained without a debugger. Of course having the line numbers helps enormously.
Open Source Realtime Strategy Game Engine
https://springrts.com/phpbb/
Code: Select all
bool CUnit::LoadBehaviours(){
string d = G->Get_mod_tdf()->SGetValueDef("auto","AI\\behaviours\\"+ud->name);
vector<string> v;
CTokenizer<CIsComma>::Tokenize(v, d, CIsComma());
if(!v.empty()){
for(vector<string>::iterator vi = v.begin(); vi != v.end(); ++vi){
string s = *vi;
trim(s);
tolowercase(s);
if(s == "none"){
return true;
} else if(s == "metalmaker"){
boost::shared_ptr<IBehaviour> t = boost::shared_ptr<IBehaviour>(new CMetalMakerBehaviour(G, *me));
behaviours.push_back(t);
t->Init(t);
} else if(s == "attacker"){
boost::shared_ptr<IBehaviour> t = boost::shared_ptr<IBehaviour>(new CAttackBehaviour(G, *me));
behaviours.push_back(t);
t->Init(t);
} else if(s == "auto"){
if(G->UnitDefHelper->IsAttacker(ud)){
// THIS LINE BELOW CRASHPOINT
boost::shared_ptr<IBehaviour> t = boost::shared_ptr<IBehaviour>(new CAttackBehaviour(G, *me));
behaviours.push_back(t);
t->Init(t);
}
if(G->UnitDefHelper->IsMetalMaker(ud)||(G->UnitDefHelper->IsMex(ud) && ud->onoffable ) ){
boost::shared_ptr<IBehaviour> t = boost::shared_ptr<IBehaviour>(new CMetalMakerBehaviour(G, *me));
behaviours.push_back(t);
t->Init(t);
}
}
}
}
return true;
}
Code: Select all
#0 0x00002aaab188f5ae in boost::detail::atomic_increment (pw=0x484962)
at /usr/include/boost/detail/sp_counted_base_gcc_x86.hpp:66
#1 0x00002aaab188f629 in boost::detail::sp_counted_base::add_ref_copy (this=0x48495a)
at /usr/include/boost/detail/sp_counted_base_gcc_x86.hpp:133
#2 0x00002aaab188f70e in shared_count (this=0x7fff2f42aa98, r=@0x7fff2f42ad98)
at /usr/include/boost/detail/shared_count.hpp:170
#3 0x00002aaab188f8eb in shared_ptr (this=0x7fff2f42aa90)
at /usr/include/boost/shared_ptr.hpp:106
#4 0x00002aaab188c06c in CUnit::LoadBehaviours (this=0xb0a4740)
at AI/Global/NTai/AI/NTai/Units/CUnit.cpp:291
#5 0x00002aaab188e9a6 in CUnit::RecieveMessage (this=0xb0a4740, message=@0x7fff2f42ad20)
at AI/Global/NTai/AI/NTai/Units/CUnit.cpp:88
#6 0x00002aaab1919619 in Global::FireEvent (this=0x8ef78b0, message=@0x7fff2f42ad20)
at AI/Global/NTai/AI/NTai/Core/helper.cpp:1544
#7 0x00002aaab1927ec9 in Global::UnitFinished (this=0x8ef78b0, unit=2)
at AI/Global/NTai/AI/NTai/Core/helper.cpp:476
#8 0x00002aaab1918365 in CNTai::UnitFinished (this=0x18e30a0, unit=2)
at AI/Global/NTai/AI/NTai/Core/GlobalAI.cpp:113
#9 0x000000000057a647 in CGlobalAIHandler::UnitFinished (this=0x9acde00, unit=0xaf6e200)
at rts/ExternalAI/GlobalAIHandler.cpp:201
#10 0x00000000007dfcb5 in CUnit::FinishedBuilding (this=0xaf6e200)
at rts/Sim/Units/Unit.cpp:1699
#11 0x00000000007f1bc7 in CUnitLoader::LoadUnit (this=0xef4910, name=@0x7fff2f42b340,
pos=@0x7fff2f42b330, side=1, build=false, facing=0, builder=0x0)
at rts/Sim/Units/UnitLoader.cpp:321
#12 0x000000000079a688 in CGlobalAITestScript::Update (this=0xf51ce0)
at rts/Game/StartScripts/GlobalAITestScript.cpp:57
#13 0x00000000006d97a5 in CGame::SimFrame (this=0x1800f50) at rts/Game/Game.cpp:2322
#14 0x00000000006dff94 in CGame::ClientReadNet (this=0x1800f50) at rts/Game/Game.cpp:2734
#15 0x00000000006e426a in CGame::Update (this=0x1800f50) at rts/Game/Game.cpp:1776
#16 0x00000000006250f9 in SpringApp::Update (this=0x7fff2f42ba10) at rts/System/Main.cpp:838
#17 0x0000000000628e9c in SpringApp::Run (this=0x7fff2f42ba10, argc=1, argv=0x7fff2f42bb88)
at rts/System/Main.cpp:1023
#18 0x0000000000629024 in Run (argc=1, argv=0x7fff2f42bb88) at rts/System/Main.cpp:1083
#19 0x000000000062924d in main (argc=1, argv=0x7fff2f42bb88, envp=0x7fff2f42bb98)
at rts/System/Main.cpp:1136
/usr/bin/ld: .objs/NTai/Agents/CManufacturer.o: relocation R_X86_64_32 against `vtable for SkyWrite' can not be used when making a shared object; recompile with -fPIC
.objs/NTai/Agents/CManufacturer.o: could not read symbols: Bad value