hey,
diffs look good. A few comments on the code: - where you do if(!owner->CastToClient()->GetFeigned()){, you need to be sure that owner is a client first, use if(owner->IsClient() && !owner->Cast.... - make the 120000 value part of the timer duration enum in features.h - you should check feigned before you call scanarea_timer.Check... so put the check between 'ret and 'scanarea_timer.Check()', also call GetFeigned instead of using `feigned` directly. - Please do not use the LinkedList data structure, we are doing everything we can to get rid of that, use the STL vector or list.. further, never store string pointers in a data structure like that unless you can garuntee the existence of that pointer until the list is cleared (which you cannot in this case). Use a STL string object in the future... BUT you should not be storing the character's name in the list anyhow, its use their ->CharacterID() and then use GetClientByCharID - Do not use rand()/RAND_MAX, use MakeRandomInt/Float. - Do not use CastToMob() unless you truely have a pointer to an Entity object (basically nowhere)... everything else is already derived from a Mob, and does not require a cast. - Your use of CastToNPC() in ClearFeignAggro is unnescecary, your iterator is already an NPC *... casting is bad, avoid at all costs. - In ClearFeignAggro, you need to either check to see if the object is a Client object before calling CastToClient for AddFeignMemory, or you need to make ClearFeignAggro take a Client *, and have its caller check it. - please remove depricated functions, in particular SetFeignMemory and the feign_memory member variable) - Please only send emotes/messages to the client when they match what live sends, if you add other things for debugging, please use the _log facility instead (use #logs to get messages in game) |
I'll work on these changes over the weekend and see how far I can get. Using the STL stuff will be something new to learn but the rest of it seems straightforward. Thanks for the feedback on my rusty c skills :)
Will post a new diff when I have another draft ready. |
Latest Diff
Here is the latest diffs after making the recommended changes.
Code:
--- C:\Code\EQEmu800\zone\attack.cpp Wed Jun 07 18:29:26 2006 |
Diffs (Cont)
Code:
--- C:\Code\EQEmu800\zone\npc.cpp Wed May 31 21:13:32 2006 |
ok,
Looks good. I got this in, untested, so grab the next build with it mentioned in the changelog and test it for me. I made a few changes. - I fixed an iterator delete bug, you cannot remove an element from any STL container and expect the iterator which pointed to that element to stay valid. Each container has its own erase-while-iterating rules and trick. - I also changed it from a list to a set, just to ensure uniqueness. - I moved everything up into Mob so in theory charmed players would exhibit the same behavior. (plus it made the next comment easier) - Its bad form to name two timers the same thing when they have different purposes, it confused me for a while. Your NPC forget check timer was also somewhat unnescesary (as well as being in a bad spot, that code gets called very rapidly, and your slower timer should be burried inside other shorter timers so it dosent get checked so often.) Because of this, I just eliminated it, and moved the "look for people who got up" code into the AI scan area timer (where we look for people to aggro, which had the same duration). |
Great! I look forward to seeing how you implemented the above mentioned changes. The more I learn about the structure and where things should go and what the best objects to use in which situations, the more effective I can fix and or add features. For the immediate future I plan to focus on fixes to the necro class since it's a class I know thoroughly. I hope that more people with class specific knowledge can do the same to free the core devs up for the important things like getting AA's working in 7.0 :)
|
I grabbed v.812 and did some testing. I found that I am not being remembered. I popped in a debug to tell me when I was being added to the feign memory list and that seems to be working fine. However when I stand up the mob does not remember me and add me to his hate list. It looks as though the memory check isn't being executed. It also looks to me as if the memory check won't occur if the mob is engaged. I'm thinking the mob should remember you even if it's fighting with someone else and you get up.
i.e. If I pull a mob to my group and feign. While the group is fighting the mob , I stand up. My groupies wipe. I should have been remembered when I stood up while the mob was engaged so that when my groupies wipe I am on the hate list even though I may be out of aggro range. I'm not sure about this as I haven't had time to think through all the possible situations. FNW: do you want me to try and debug whats going wrong with the memory check the way you implemented it or do you have time to debug it? |
what you describe is ultimately what should happen, as soon as the mob is no longer engaged (500ms later prolly), it will look for people to remember, but not until it is no longer engaged (no point in checking while engaged since we come back with only 1 hate).
feel free to debug it. |
Just got back into town, that makes sense. I'll toss in some debug messages and such and see if I can track down why they aren't remembering me when I get up even though I've been added to feign memory.
|
Found the culprit...
This is causing fd memory to never be checked.
Code:
#ifdef REVERSE_AGGRO |
ah crap, forgot about reverse aggro.
I moved it to its own AI timer, give it a try next rev. |
Works like a charm in 0.7.0-815 :)
I need to play more to know for sure but it feels like they don't remember you often enough so perhaps we should make the chance to remember a user defined percentage. |
All times are GMT -4. The time now is 06:08 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.