diff --git a/src/xrGame/ai/stalker/ai_stalker_misc.cpp b/src/xrGame/ai/stalker/ai_stalker_misc.cpp index f82638f1ae3..ee0268939da 100644 --- a/src/xrGame/ai/stalker/ai_stalker_misc.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_misc.cpp @@ -203,6 +203,11 @@ void CAI_Stalker::process_enemies() continue; } + //Alundaio: Only transfer enemy if I can see member at this very moment! + if (!memory().visual().visible_now(member)) + continue; + //Alundaio: END + memory().make_object_visible_somewhen(member->memory().enemy().selected()); found = true; break; diff --git a/src/xrGame/alife_online_offline_group.cpp b/src/xrGame/alife_online_offline_group.cpp index 58e306b4c5f..404ca9736fc 100644 --- a/src/xrGame/alife_online_offline_group.cpp +++ b/src/xrGame/alife_online_offline_group.cpp @@ -366,6 +366,25 @@ void CSE_ALifeOnlineOfflineGroup::force_change_position(Fvector position) // m_tGraphID = new_graph_vertex; } +//Alundaio: force new graph location +/* +void CSE_ALifeOnlineOfflineGroup::force_change_game_vertex_id(u32 game_vertex_id) +{ + if (game_vertex_id && ai().game_graph().valid_vertex_id(game_vertex_id)) + { + const CGameGraph::CVertex vertex = *ai().game_graph().vertex(game_vertex_id); + m_tNodeID = vertex.level_vertex_id; + o_Position = vertex.level_point; + + if (m_tGraphID != game_vertex_id) + { + alife().graph().change(this, m_tGraphID, game_vertex_id); + } + } +} +*/ +//Alundaio: END + void CSE_ALifeOnlineOfflineGroup::on_failed_switch_online() { MEMBERS::const_iterator I = m_members.begin(); diff --git a/src/xrGame/stalker_combat_actions.cpp b/src/xrGame/stalker_combat_actions.cpp index c17b053e480..48254c2d538 100644 --- a/src/xrGame/stalker_combat_actions.cpp +++ b/src/xrGame/stalker_combat_actions.cpp @@ -784,8 +784,10 @@ void CStalkerActionDetourEnemy::initialize() object().agent_manager().member().member(m_object).cover(0); //#ifndef SILENT_COMBAT - if (object().memory().enemy().selected()->human_being() && object().agent_manager().member().group_behaviour()) - // object().sound().play (eStalkerSoundNeedBackup); + //Alundaio: Sanity + if (object().memory().enemy().selected() && object().memory().enemy().selected()->human_being() && object().agent_manager().member().group_behaviour()) + //Alundaio: END + //object().sound().play(eStalkerSoundNeedBackup); object().sound().play(eStalkerSoundDetour); //#endif } @@ -806,6 +808,11 @@ void CStalkerActionDetourEnemy::execute() inherited::execute(); + //Alundaio: Sanity + if (!object().memory().enemy().selected()) + return; + //Alundaio: END + CMemoryInfo mem_object = object().memory().memory(object().memory().enemy().selected()); if (!mem_object.m_object) @@ -1009,8 +1016,10 @@ void CStalkerActionSuddenAttack::execute() inherited::execute(); - if (object().agent_manager().member().combat_members().size() > 1) - m_storage->set_property(eWorldPropertyUseSuddenness, false); + //Alundaio: Removed check to allow stalkers to sneak up on enemy even if they are in a squad; most likely removed because of friendly fire but not an issue with rx_ff scheme + //if (object().agent_manager().member().combat_members().size() > 1) + // m_storage->set_property(eWorldPropertyUseSuddenness, false); + //Alundaio: END if (!object().memory().enemy().selected()) return; @@ -1133,6 +1142,11 @@ void CStalkerActionKillEnemyIfPlayerOnThePath::execute() inherited::execute(); + //Alundaio: Sanity + if (!object().memory().enemy().selected()) + return; + //Alundaio: END + object().sight().setup(CSightAction(object().memory().enemy().selected(), true, true)); fire(); diff --git a/src/xrGame/stalker_danger_in_direction_actions.cpp b/src/xrGame/stalker_danger_in_direction_actions.cpp index 35d21d777e1..27332d85f87 100644 --- a/src/xrGame/stalker_danger_in_direction_actions.cpp +++ b/src/xrGame/stalker_danger_in_direction_actions.cpp @@ -145,6 +145,11 @@ void CStalkerActionDangerInDirectionLookOut::execute() { inherited::execute(); + //Alundaio: This action should verify the danger object exists; sanity + if (!object().memory().danger().selected()) + return; + //Alundaio: END + // CMemoryInfo mem_object = // object().memory().memory(object().memory().danger().selected()->object()); // diff --git a/src/xrGame/xrServer_process_event_reject.cpp b/src/xrGame/xrServer_process_event_reject.cpp index a7f68a90e8c..b0913feff68 100644 --- a/src/xrGame/xrServer_process_event_reject.cpp +++ b/src/xrGame/xrServer_process_event_reject.cpp @@ -42,7 +42,7 @@ bool xrServer::Process_event_reject( xr_vector::iterator c = std::find(C.begin(), C.end(), id_entity); if (c == C.end()) { - Msg("! ERROR: SV: can't find children [%d] of parent [%d]", id_entity, e_parent); + Msg("! WARNING: SV: can't find children [%d] of parent [%d]", id_entity, e_parent); return false; } diff --git a/src/xrServerEntities/xrServer_Objects_ALife_Monsters.h b/src/xrServerEntities/xrServer_Objects_ALife_Monsters.h index 7897d02e6bd..491c66937b6 100644 --- a/src/xrServerEntities/xrServer_Objects_ALife_Monsters.h +++ b/src/xrServerEntities/xrServer_Objects_ALife_Monsters.h @@ -720,6 +720,7 @@ class CSE_ALifeOnlineOfflineGroup : public CSE_ALifeDynamicObject, void clear_location_types(); void add_location_type(LPCSTR mask); void force_change_position(Fvector position); + //void force_change_game_vertex_id(u32 game_vertex_id); virtual void on_failed_switch_online(); #else public: diff --git a/src/xrServerEntities/xrserver_objects_alife_monsters_script3.cpp b/src/xrServerEntities/xrserver_objects_alife_monsters_script3.cpp index 4357c8698bf..7e6b3b8ee48 100644 --- a/src/xrServerEntities/xrserver_objects_alife_monsters_script3.cpp +++ b/src/xrServerEntities/xrserver_objects_alife_monsters_script3.cpp @@ -63,6 +63,7 @@ static void CSE_ALifeOnlineOfflineGroup_Export(lua_State* luaState) .def("add_location_type", &CSE_ALifeOnlineOfflineGroup::add_location_type) .def("clear_location_types", &CSE_ALifeOnlineOfflineGroup::clear_location_types) .def("force_change_position", &CSE_ALifeOnlineOfflineGroup::force_change_position) + //.def("force_change_game_vertex_id", &CSE_ALifeOnlineOfflineGroup::force_change_game_vertex_id) #endif ]; }