AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   (OLD) Bug Reports (https://forums.alliedmods.net/forumdisplay.php?f=24)
-   -   [DoDx] dod_get_map_info non functional after a few mapchange (https://forums.alliedmods.net/showthread.php?t=17424)

FeuerSturm 08-31-2005 17:43

[DoDx] dod_get_map_info non functional after a few mapchange
 
hey guys,

the native dod_get_map_info(info) is starting to act weird
after a few mapchanges.

it's used to get info about the teams on the current map with
dod_get_map_info(MI_ALLIES_TEAM) which is 0 for americans and 1 for british team.
and
dod_get_map_info(MI_ALLIES_PARAS) which is 0 if it's normal troops and 1 if it's para troops.
and
dod_get_map_info(MI_AXIS_PARAS) which is 0 if it's normal troops and 1 if it's para troops.

the detection simply isn't working anymore and always the britisch team
is detected even if it's americans and always the paratroops are detected,
even if it's normal troops.

that strange behavior happens since 1.50beta and is seriously screwing
up a lot of my plugins.
a lot of people have reported that and i tested it myself on standard maps.

i would really be greatful if SidLuke or one of the other devs would
take a look at it!

i seriously need this working!

thanks guys!

SidLuke 09-01-2005 08:21

Re: [DoDx] dod_get_map_info non functional after a few mapch
 
Quote:

Originally Posted by FireStorm
that strange behavior happens since 1.50beta

Strange, I did not change anything there :?
OnAmxxAttach() function should clear map info ( g_map.Init() ) after map change :?

FeuerSturm 09-01-2005 10:14

okay, here's some more info to bring some light into the dark!

i used this little plugin to get some more info:
Code:
#include <amxmodx> #include <dodx> public plugin_init(){     register_plugin("Test TeamDetect","1.0","[RST] FireStorm")     set_task(5.0,"get_info") } public get_info(){     log_to_file("TeamDetect.log","==============================")     new currmapname[32]     get_mapname(currmapname,31)     log_to_file("TeamDetect.log","Current map: %s",currmapname)     if(dod_get_map_info(MI_ALLIES_TEAM) == 0){         log_to_file("TeamDetect.log","Current Allied Team: Americans")     }     if(dod_get_map_info(MI_ALLIES_TEAM) == 1){         log_to_file("TeamDetect.log","Current Allied Team: Brits")     }     if(dod_get_map_info(MI_ALLIES_PARAS) == 0){         log_to_file("TeamDetect.log","Allied Forces: Standard Troops")     }     if(dod_get_map_info(MI_ALLIES_PARAS) == 1){         log_to_file("TeamDetect.log","Allied Forces: Para Troops")     }     if(dod_get_map_info(MI_AXIS_PARAS) == 0){         log_to_file("TeamDetect.log","Axis Forces: Standard Troops")     }     if(dod_get_map_info(MI_AXIS_PARAS) == 1){         log_to_file("TeamDetect.log","Axis Forces: Para Troops")     }     return PLUGIN_HANDLED }

and it seems that the first map with Brits locks the team info as well
as the first map with para troopers locks the para info.

i hope that helps a bit to fix it!

here's the log:


P.S.:
@SidLuke:
i didn't say that you messed it up, that's why i posted it here :wink:

BAILOPAN 09-01-2005 23:30

Re: [DoDx] dod_get_map_info non functional after a few mapch
 
1 Attachment(s)
Quote:

Originally Posted by SidLuke
Strange, I did not change anything there :?
OnAmxxAttach() function should clear map info ( g_map.Init() ) after map change :?

No, it shouldn't :) as of 1.50, metamod-modules don't reload on mapchange. Relying OnAmxxAttach() will only get when module is loaded. I've switched this in CVS to "g_map.Init()" on ServerActivate, which is guaranteed to be called at the right time.

So, this bug should be fixed. I've attached a test binary. If it's not fixed, I'm leaving this report open so SidLuke can ask questions or fix up his other modules that might be affected by this change.

Thanks!

windy 09-02-2005 09:48

Thanks, I will test this on my Windows server :)


Do you have a dodx_amxx_i386.so Linux version as well by any chance? 8)

FeuerSturm 09-02-2005 10:16

unfortunately it's not working, now the info isn't updated at all
anymore and keeps:
Code:

Current Allied Team: Americans
Allied Forces: Standard Troops
Axis Forces: Standard Troops

for all maps, no matter which one is played :cry: :cry:

SidLuke 09-02-2005 12:50

Bailopan .. i will fix it

g_map.Init() must be in OnAmxxAttach()
and I will add it also in ServerDeactivate ...



:!: ServerActivate is after DispatchKeyValue ...


All times are GMT -4. The time now is 07:05.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.