![]() |
botmaaaaaaaaan!!!!!
O knowledgeable guru, I need thy immense wisdom again...
... and especially your ability to check one thing or two in the Half-Life source code, if you don't mind :) I've f*ckedup a metamod plugin, but completely, and as usuals I didn't make backups. That's because the error only occurs on some situations and I never noticed it before. But it's very reproductible indeed: the plugin is Count Floyd's POD-bot, and the crash occurs randomly although very often, only on "cs_" maps, i.e, maps with hostages. The error I get is: NUM_FOR_EDICT: bad pointer. Does this sound familiar to you ?? I scoured the source code again and again to no avail. I'm becoming desperate as I need this stupid error to be fixed quickly in order to make a release of this bot and move on to other things (mine, and the united bot thingy). And where I enrage is when I see that the engine exits gracefully with a nice MessageBox, and who says messagebox says no real crash, and who says no crash says NO BREAK IN THE FRIKKIN DEBUGGER !!! I don't give a foack about message boxes, I ONLY WISHED MY DEBUGGER WOULD KICK IN RIGHT AT THE ERROR !!! If (and as I believe) that's impossible, could you have a look in the engine source code and tell me where are the main places where this error can occur ? I assume the bot is calling an engine function with a fucked parameter, but if I could narrow down my search and avoid checking one after the other the 5,000 engine function calls there are in this stupid bot source code I would be quite pleased. What does this error mean ? I thought it was related to INDEXENT() and ENTINDEX() where you would for example ask the engine for a pointer to an edict_t by number, and passing a number out of range, but I've quintuple-checked these two everywhere I could find them to no avail. I'm clueless ! What does this error mean ? In which engine function(s) does it kick in ? Please don't tell me "everywhere", I would go mad, please :'( |
Re: botmaaaaaaaaan!!!!!
Try looking in the quake 1 source code, I did a quick google for NUM_FOR_EDICT and a few quake source files turned up.
[ Added ] From looking around in the quake source, it looks like it is used by ENTINDEX( edict_t* ). Everywhere I have looked so far uses NUM_FOR_EDICT to get the index of an entity, still looking though. |
Re: botmaaaaaaaaan!!!!!
bah don't worry, I made a great fuss again for not very much ----> it's FIXED. w00h00h000000t!!!
Actually I spent hours on it, but the only method that works when all the other fails remain the trial and error: you comment out (/* like this */) half of the code, then compile the bot and see if it crashes. If it doesn't you uncomment half of what you'd commented and you try again. If it doesn't you uncomment half of it again, until you narrow down the bug. :) The line that was causing the error was, believe it or not: Code:
pPlayer = ThreatTab[i].pEntity; Anyhow I put it back because I've found the REAL problem elsewhere in this very function. Count Floyd has the very bad habit of declaring his variable names everywhere BUT where they should be declared. Code:
void SomeFunction (edict_t *pPlayer) // first definition of pPlayer Anyway I'm still interested in knowing what the NUM_FOR_EDICT(): bad pointer error means :) |
Re: botmaaaaaaaaan!!!!!
Code:
int NUM_FOR_EDICT(edict_t *e) Looks like the error is made when the entity index is below zero or greater than the amount of entities in the game. |
All times are GMT +2. The time now is 12:10. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.