Код
1) stalker_animation_manager_update.cpp
// Исправление вылета типа "! error in stalker with visual"
void CStalkerAnimationManager::update ()
{
START_PROFILE("stalker/client_update/animations")
try {
update_impl ();
}
catch(...) {
Msg ("Error in stalker with visual [%s]",*object().cNameVisual());
global().reset ();
head().reset ();
torso().reset ();
legs().reset ();
return;
}
STOP_PROFILE
}
2) game_graph_inline.h
// Исправление вылета типа "There is no proper graph point neighbour!"
IC float CGameGraph::distance (const _GRAPH_ID tGraphID0, const _GRAPH_ID tGraphID1) const
{
float mDist = 54.767998f;
const_iterator i, e;
begin (tGraphID0,i,e);
for (; i != e; ++i){
if (value(tGraphID0,i) == tGraphID1){
return (edge_weight(i));
}
}
Msg ("ERROR: There is no proper graph point neighbour!");
return (mDist);
}
// Исправление вылета типа "there is no specified level in the game graph:"
IC const GameGraph::SLevel &GameGraph::CHeader::level (const _LEVEL_ID &id) const
{
LEVEL_MAP::const_iterator I = levels().find(id);
if(I != levels().end()){
return ((*I).second);
}
else{
Msg ("ERROR: There is no specified level in the game graph: [%d]",id);
return (levels().begin()->second);
}
}
// Исправление вылета типа "! There is no specified level %s in the game graph!"
IC const GameGraph::SLevel &GameGraph::CHeader::level (LPCSTR level_name) const
{
LEVEL_MAP::const_iterator I = levels().begin();
LEVEL_MAP::const_iterator E = levels().end();
for (; I != E; ++I){
if (!xr_strcmp((*I).second.name(),level_name)){
return ((*I).second);
}
}
Msg ("ERROR: There is no specified level [%s] in the game graph!",level_name);
return (levels().begin()->second);
}
3) xrServer_process_event_reject.cpp (приводится целиком)
#include "stdafx.h"
#include "xrserver.h"
#include "xrserver_objects.h"
bool xrServer::Process_event_reject (NET_Packet& P, const ClientID sender, const u32 time, const u16 id_parent, const u16 id_entity, bool send_message)
{
// Parse message
CSE_Abstract* e_parent = game->get_entity_from_eid (id_parent);
CSE_Abstract* e_entity = game->get_entity_from_eid (id_entity);
#ifdef DEBUG
Msg("sv reject. id_parent %s id_entity %s [%d]",ent_name_safe(id_parent).c_str(),ent_name_safe(id_entity).c_str(), Device.dwFrame);
#endif
// Исправление вылета по "xrServer::Process_event_reject ... e_parent && e_entity"
if ( !e_entity ) {
Msg ( "ERROR: Entity not found. parent_id = [%d], entity_id = [%d], frame = [%d]. Process_event_reject()", id_parent, id_entity, Device.dwFrame );
return (false);
}
if ( !e_parent ) {
Msg ( "ERROR: Parent not found. parent_id = [%d], entity_id = [%d], frame = [%d]. Process_event_reject()", id_parent, id_entity, Device.dwFrame );
return (false);
}
xr_vector<u16>& C = e_parent->children;
xr_vector<u16>::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);
return (false);
}
if (0xffff == e_entity->ID_Parent)
{
Msg ("ERROR: Can't detach independant object. entity[%s][%d], parent[%s][%d], section[%s]",
e_entity->name_replace(), id_entity, e_parent->name_replace(), id_parent, e_entity->s_name.c_str() );
return (false);
}
if (e_entity->ID_Parent != id_parent)
{
Msg("ERROR: e_entity->ID_Parent = [%d], parent = [%d][%s], entity_id = [%d], frame = [%d]",
e_entity->ID_Parent, id_parent, e_parent->name_replace(), id_entity, Device.dwFrame);
}
game->OnDetach(id_parent,id_entity);
// Rebuild parentness
e_entity->ID_Parent = 0xffff;
C.erase (c);
// Signal to everyone (including sender)
if (send_message)
{
DWORD MODE = net_flags(TRUE,TRUE, FALSE, TRUE);
SendBroadcast (BroadcastCID,P,MODE);
}
return (true);
}