Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"replay this map" doesn't indicate gametype #5

Closed
ghost opened this issue Feb 12, 2023 · 11 comments
Closed

"replay this map" doesn't indicate gametype #5

ghost opened this issue Feb 12, 2023 · 11 comments

Comments

@ghost
Copy link

ghost commented Feb 12, 2023

Hello

A map is included twice in the mapRotation of my server, with different gametype

On this map, mapvote displays twice "replay this map" without indicating gametype, as you could see on the following screenshot :

missing gametype replay

On other maps, mapvote displays twice the map, indicating gametype.

Could you do something for that please ?

@cato-a
Copy link
Owner

cato-a commented Feb 12, 2023

Hi, you probably have too few maps left in the rotation. Add one more map to the rotation and you should have 4 maps displayed. You need to have at least 4 unique maps left in the rotation.

@ghost
Copy link
Author

ghost commented Feb 12, 2023

@cato-a
There are 4 unique maps in the rotation

Here it is : gametype dm map zh_king map mp_harbor gametype tdm map suldal_harbor gametype sd map german_town map zh_king

@cato-a
Copy link
Owner

cato-a commented Feb 12, 2023

Yes you have 4 unique maps, but one map is used for "replay this map", so you only have 3 unique maps left in the rotation.

@ghost
Copy link
Author

ghost commented Feb 15, 2023

I just realized that the two replay choices are the same gametype.

I'm trying to change that and will make a pull request if I succeed.

@cato-a
Copy link
Owner

cato-a commented Feb 15, 2023

There is no issue here. You need to add 1 more map so that you have enough unique maps in the rotation (4 unique maps in rotation + "replay this map" = 5 unique maps in total). For the rotation to work you need to have a minimum of 5 unique maps.

@ghost
Copy link
Author

ghost commented Feb 15, 2023

For my servers, I want all the possibilities to be displayed in mapvote, so I have 5 in maprotation.

Here is how it looks on the maps that are not the one included twice :

ok
Exactly what I want.

And here is how it looks on the map included twice :

not ok


For me it's a problem that's why I try to modify the behavior.

@cato-a
Copy link
Owner

cato-a commented Feb 15, 2023

Yes, I understand, but MiscMod support unique maps, not duplicate maps. The bug is rather duplicate maps show up in the vote if the gametype is different. So "replay this map" and "mystery map" will remove any non-unique maps.

So to do what you want you must edit _mm_mapvote.gsc

Find this code and comment it out/delete (line 465/466):

    if(codam\_mm_mmm::in_array(mapRotation, level.mmmapname))
        mapRotation = codam\_mm_mmm::array_remove(mapRotation, level.mmmapname, true);

Replace (from line 502) with something like this:

            case "map":
                if((i + 1) < mapRotation.size
                    && (lastgt != level.mmgametype || mapRotation[i + 1] != level.mmmapname)) {
                    _tmp[_tmp.size]["gametype"] = lastgt;
                    _tmp[_tmp.size - 1]["map"]  = mapRotation[i + 1];
                }

                i += 2;
            break;

Try it out and see if it works.

@ghost
Copy link
Author

ghost commented Feb 15, 2023

I thank you very much for your help, I tried after modifying _mm_mapvote.gsc doing exactly what you wrote.

On the duplicated map (zh_king) DM, here is how it looks now :

current dm

When voted for the SD version, the game goes back to main menu without trying to load the map and displays this error :

dm to sd bomb error

It seems there is no problem after entering /reconnect.


On the duplicated map SD, here is how it looks now :

current sd

When voted for the DM version, the team menu appears (like just arrived on the server), without loading the map.
It seems there is no gameplay problem.


I will try to fix that, if I succeed I will explain here how I done it.
Any info / ideas would be appreciated.

@ghost
Copy link
Author

ghost commented Feb 16, 2023

It looks that StartGameType is not called

@cato-a
Copy link
Owner

cato-a commented Feb 16, 2023

Different objects are precached in DM and SD gametype, so when it doesn't do a full map reload you get kicked out if those precaches are missing. It seems it doesn't do a full map reload when the rotation goes to same map.

It works from SD to DM because all the objects DM needs are precached in SD.
I guess you could try to precache it always and see if it works. And repeat for every other errors.

precacheModel("xmodel/mp_bomb1_defuse");

At least the code I made for you worked.

@ghost
Copy link
Author

ghost commented Feb 16, 2023

Thank you very much, it works now.

Here is how I done it :
mapvote_replay_othergametype.zip

I will probably create a repository if I make something powerful, such as reading maprotation instead of having to manually detect maps etc

@ghost ghost closed this as completed Feb 16, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant