.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Programming
General Programming Help others and get yourself helped here!

Reply
 
Thread Tools
Re: pfnRunPlayerMove - why it may crash?
Old
  (#11)
jeefo
путинхуйлоебаное
 
jeefo's Avatar
 
Status: Offline
Posts: 453
Join Date: Nov 2005
Location: Saint-Petersburg
Default Re: pfnRunPlayerMove - why it may crash? - 12-04-2006

CS1.5 Working without problems with or without this entity. I have no idea why this sh*t crashing, maybe because pod's trying pickup the entity, but entity already removed from the map, that cause bot to pickup weapon that already has null ptr.

Tested this maps with Official CSBot on CZ, there is not any problems...
  
Reply With Quote
Re: pfnRunPlayerMove - why it may crash?
Old
  (#12)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: pfnRunPlayerMove - why it may crash? - 19-05-2006

That pfnRunPlayerMove function crashes also in such situations - If You let Your bot to shoot at some breakable with entity having some v.impulse value > 0, as soon it is shooting at it, the CS crashes in pfnRunPlayerMove. All speeds arguments of bot were as 0, nothing special there, but the game crashes exactly in that function (at least the debugger of MS VC++ 2005 Express shows it). mingw shows the crash in mp.dll (the memory can't be read).
  
Reply With Quote
Re: pfnRunPlayerMove - why it may crash?
Old
  (#13)
jeefo
путинхуйлоебаное
 
jeefo's Avatar
 
Status: Offline
Posts: 453
Join Date: Nov 2005
Location: Saint-Petersburg
Default Re: pfnRunPlayerMove - why it may crash? - 19-05-2006

Quote:
Originally Posted by KWo
That pfnRunPlayerMove function crashes also in such situations - If You let Your bot to shoot at some breakable with entity having some v.impulse value > 0, as soon it is shooting at it, the CS crashes in pfnRunPlayerMove. All speeds arguments of bot were as 0, nothing special there, but the game crashes exactly in that function (at least the debugger of MS VC++ 2005 Express shows it). mingw shows the crash in mp.dll (the memory can't be read).
Debugger VC++ 2005 Pro, everytime shows crash somewhere in mp.dll or metamod, however, there is a call for pfnRunplayermove in callstack window, from bot library, but crash is not in this function. Just as a test i've add try/catch block on this function and set MSVC option Enable C++ Excpetions = Yes With SEH Exceptions (/EHa)
Code:
try
{
   (*g_engfuncs.pfnRunPlayerMove) (GetEntity (), m_vMoveAngles, m_fMoveSpeed, m_fSideMoveSpeed, 0, pev->button, pev->impulse, static_cast <byte> (m_iMsecVal));
}
catch (...)
{
   CFile Err ("error.log", "at");
   Err.Printf ("pfnRPM %s - CRASH!\n", STRING (pev->netname));
   Err.Close ();
}
File "error.log", was never created, but game is crashes as always. Try/catch catching all errors even something like that "*((int *) 0) = 0;", or if error not occurs in our library. So i think error is in mp.dll, and not caused buy pfnRPM.
  
Reply With Quote
Re: pfnRunPlayerMove - why it may crash?
Old
  (#14)
jeefo
путинхуйлоебаное
 
jeefo's Avatar
 
Status: Offline
Posts: 453
Join Date: Nov 2005
Location: Saint-Petersburg
Default Re: pfnRunPlayerMove - why it may crash? - 19-05-2006

Ok! Maybe it might help. Found workaround for this bug, add to dll.cpp in DispatchSpawn function.

Code:
   else if (strcmp (STRING (pent->v.classname), "player_weaponstrip") == 0)
   {
      pent->v.target = MAKE_STRING ("fake");
      pent->v.targetname = MAKE_STRING ("fake");
   }
Weapons is stripped as always, but game is not crashing...
  
Reply With Quote
Re: pfnRunPlayerMove - why it may crash?
Old
  (#15)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: pfnRunPlayerMove - why it may crash? - 20-05-2006

Thanks fo the hint, but is there also some workaround for this what I was elaborating about crash with breakables they have v.impulse > 0? It crashes also in mp dll, but last bot function called before crash is pfnRunPlayerMove.
  
Reply With Quote
Re: pfnRunPlayerMove - why it may crash?
Old
  (#16)
jeefo
путинхуйлоебаное
 
jeefo's Avatar
 
Status: Offline
Posts: 453
Join Date: Nov 2005
Location: Saint-Petersburg
Default Re: pfnRunPlayerMove - why it may crash? - 20-05-2006

Ok, please tell me one map with such entities...

Quote:
It crashes also in mp dll, but last bot function called before crash is pfnRunPlayerMove
pfnRPM is engine fnction, and maybe it last because it called 10 times in a frame for 10 bots?
  
Reply With Quote
Re: pfnRunPlayerMove - why it may crash?
Old
  (#17)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: pfnRunPlayerMove - why it may crash? - 20-05-2006

cs_arabstreets. In the building where terrorists spawn, there are some barrels. They have v.impulse about 60.
  
Reply With Quote
Re: pfnRunPlayerMove - why it may crash?
Old
  (#18)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: pfnRunPlayerMove - why it may crash? - 20-05-2006

Not sure if will help but use pEdict->v.impulse in runplayermove()
I see in to the PODbot_mm sources that you call runplayermove() in this way
Code:
g_engfuncs.pfnRunPlayerMove (pEdict, vecMoveAngles, pBot->f_move_speed, pBot->f_sidemove_speed, 0, pEdict->v.button, 0, gpGlobals->frametime * 1000);
Try to make it in this way and check if will work
Code:
g_engfuncs.pfnRunPlayerMove (pEdict, vecMoveAngles, pBot->f_move_speed, pBot->f_sidemove_speed, 0, pEdict->v.button, pEdict->v.impulse, gpGlobals->frametime * 1000);
As you see after pEdict->v.button I had added pEdict->v.impulse instead of zero. Not sure if in this way it will work but you can try.
  
Reply With Quote
Re: pfnRunPlayerMove - why it may crash?
Old
  (#19)
jeefo
путинхуйлоебаное
 
jeefo's Avatar
 
Status: Offline
Posts: 453
Join Date: Nov 2005
Location: Saint-Petersburg
Default Re: pfnRunPlayerMove - why it may crash? - 20-05-2006

Nothing changed, crash as always
  
Reply With Quote
Re: pfnRunPlayerMove - why it may crash?
Old
  (#20)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: pfnRunPlayerMove - why it may crash? - 20-05-2006

Then no very good fix but at last it will work. Check if the edict have impulse > 0 and if yes then ignore it.
From EPB
Code:
bool IsShootableBreakable(edict_t * pent)
{
    return (pent->v.impulse == 0
            && pent->v.takedamage > 0
            && pent->v.health < 1000.0
            && !FBitSet(pent->v.spawnflags, SF_BREAK_TRIGGER_ONLY));
}
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com