Skip to content

Commit 41c5da6

Browse files
author
nitrocaster
committed
Merge branch 'dev' of github.com:OpenXRay/xray-16 into dev
2 parents 56551cd + e2f5ad9 commit 41c5da6

File tree

11 files changed

+30
-803
lines changed

11 files changed

+30
-803
lines changed

Open X-Ray Engine.500x268.psd

2.08 MB
Binary file not shown.

Open X-Ray Engine.psd

18.7 MB
Binary file not shown.

res/gamedata/configs/system.ltx

Lines changed: 0 additions & 786 deletions
This file was deleted.

src/xrEngine/splash_xrcs_en.bmp

0 Bytes
Binary file not shown.

src/xrGame/ActorCondition.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ void CActorCondition::UpdateTutorialThresholds()
748748
}
749749

750750
if (!b) {
751-
luabind::functor<LPCSTR> fl;
752-
R_ASSERT(ai().script_engine().functor<LPCSTR>(cb_name, fl));
751+
luabind::functor<void> fl;
752+
R_ASSERT(ai().script_engine().functor<void>(cb_name, fl));
753753
fl();
754754
}
755755
}

src/xrGame/ActorEffector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ BOOL CAnimatorCamEffector::ProcessCam(SCamEffectorInfo& info)
203203

204204
BOOL CAnimatorCamLerpEffector::ProcessCam(SCamEffectorInfo& info)
205205
{
206-
if (!inherited::inherited::ProcessCam(info)) return FALSE;
206+
if (!CEffectorCam::ProcessCam(info)) return FALSE;
207207

208208
const Fmatrix& m = m_objectAnimator->XFORM();
209209
m_objectAnimator->Update(Device.fTimeDelta);

src/xrGame/ai/stalker/ai_stalker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ void CAI_Stalker::shedule_Update(u32 DT)
10661066
}
10671067

10681068
START_PROFILE("stalker/schedule_update/inherited")
1069-
inherited::inherited::shedule_Update(DT);
1069+
CEntityAlive::shedule_Update(DT);
10701070
STOP_PROFILE
10711071

10721072
if (Remote()) {

src/xrGame/script_game_object_script2.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ class_<CScriptGameObject>& script_register_game_object1(class_<CScriptGameObject
347347
.def("set_smart_cover_target_lookout", &CScriptGameObject::set_smart_cover_target_lookout)
348348
.def("set_smart_cover_target_fire", &CScriptGameObject::set_smart_cover_target_fire)
349349
.def("set_smart_cover_target_fire_no_lookout", &CScriptGameObject::set_smart_cover_target_fire_no_lookout)
350-
.def("set_smart_cover_target_idle", &CScriptGameObject::set_smart_cover_target_idle)
351350
.def("set_smart_cover_target_default", &CScriptGameObject::set_smart_cover_target_default)
352351

353352
.def("idle_min_time", (void (CScriptGameObject::*)(float)) & CScriptGameObject::idle_min_time)

src/xrGame/script_game_object_script3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class_<CScriptGameObject>& script_register_game_object2(class_<CScriptGameObject
120120
.def("base_out_restrictions", &CScriptGameObject::base_out_restrictions)
121121
.def("accessible", &CScriptGameObject::accessible_position)
122122
.def("accessible", &CScriptGameObject::accessible_vertex_id)
123-
.def("accessible_nearest", &CScriptGameObject::accessible_nearest)
123+
.def("accessible_nearest", &CScriptGameObject::accessible_nearest, out_value<3>())
124124

125125
//////////////////////////////////////////////////////////////////////////
126126
.def("enable_attachable_item", &CScriptGameObject::enable_attachable_item)

src/xrScriptEngine/script_engine.cpp

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,12 @@ struct raii_guard : private Noncopyable
505505
{
506506
CScriptEngine* scriptEngine;
507507
int m_error_code;
508-
const char* m_error_description;
508+
const char*& m_error_description;
509509

510-
raii_guard(CScriptEngine* scriptEngine, int error_code, const char* error_description)
510+
raii_guard(CScriptEngine* scriptEngine, int error_code, const char*& error_description)
511+
:m_error_code(error_code), m_error_description(error_description)
511512
{
512513
this->scriptEngine = scriptEngine;
513-
m_error_code = error_code;
514-
m_error_description = error_description;
515514
}
516515

517516
~raii_guard()
@@ -524,9 +523,9 @@ struct raii_guard : private Noncopyable
524523
#ifdef DEBUG
525524
static const bool break_on_assert = !!strstr(Core.Params, "-break_on_assert");
526525
#else
527-
static const bool break_on_assert = true;
526+
static const bool break_on_assert = true; // xxx: there is no point to set it true\false in Release, since game will crash anyway in most cases due to XRAY_EXCEPTIONS disabled in Release build.
528527
#endif
529-
if (!m_error_code) return;
528+
if (!m_error_code) return; // Check "lua_pcall_failed" before changing this!
530529
if (break_on_assert)
531530
R_ASSERT2(!m_error_code, m_error_description);
532531
else
@@ -535,7 +534,7 @@ struct raii_guard : private Noncopyable
535534
}
536535
};
537536

538-
bool CScriptEngine::print_output(lua_State* L, LPCSTR caScriptFileName, int errorCode)
537+
bool CScriptEngine::print_output(lua_State* L, LPCSTR caScriptFileName, int errorCode, const char* caErrorText)
539538
{
540539
CScriptEngine* scriptEngine = GetInstance(L);
541540
VERIFY(scriptEngine);
@@ -564,6 +563,12 @@ bool CScriptEngine::print_output(lua_State* L, LPCSTR caScriptFileName, int erro
564563
}
565564
#endif
566565
}
566+
567+
if (caErrorText != NULL)
568+
{
569+
S = caErrorText;
570+
}
571+
567572
return true;
568573
}
569574

@@ -754,8 +759,18 @@ void CScriptEngine::lua_error(lua_State* L)
754759

755760
int CScriptEngine::lua_pcall_failed(lua_State* L)
756761
{
757-
print_output(L, "", LUA_ERRRUN);
762+
const char* sErrorText = NULL;
763+
764+
#ifndef DEBUG // Debug already do it
765+
const char* lua_error_text = lua_tostring(L, -1); // lua-error text
766+
luaL_traceback(L, L, make_string("[LUA][Error]: %s\n", lua_error_text).c_str(), 1); // add lua traceback to it
767+
sErrorText = lua_tostring(L, -1); // get combined error text from lua stack
768+
lua_pop(L, 1); // restore lua stack
769+
#endif
770+
771+
print_output(L, "", LUA_ERRRUN, sErrorText);
758772
on_error(L);
773+
759774
#if !XRAY_EXCEPTIONS
760775
xrDebug::Fatal(DEBUG_INFO, "LUA error: %s", lua_isstring(L, -1) ? lua_tostring(L, -1) : "");
761776
#endif
@@ -786,9 +801,8 @@ void CScriptEngine::setup_callbacks()
786801
#if !XRAY_EXCEPTIONS
787802
luabind::set_error_callback(CScriptEngine::lua_error);
788803
#endif
789-
#ifndef MASTER_GOLD
804+
790805
luabind::set_pcall_callback([](lua_State* L) { lua_pushcfunction(L, CScriptEngine::lua_pcall_failed); });
791-
#endif
792806
}
793807
#if !XRAY_EXCEPTIONS
794808
luabind::set_cast_failed_callback(CScriptEngine::lua_cast_failed);

0 commit comments

Comments
 (0)