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

[combatTypeToIndex] Combat type 255 is out of range #2874

Closed
2 of 5 tasks
helenarubra opened this issue Sep 5, 2024 · 9 comments · Fixed by #3095 or #3106
Closed
2 of 5 tasks

[combatTypeToIndex] Combat type 255 is out of range #2874

helenarubra opened this issue Sep 5, 2024 · 9 comments · Fixed by #3095 or #3106
Labels
Priority: Low Minor impact Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@helenarubra
Copy link

Priority

Low

Area

  • Datapack
  • Source
  • Map
  • Other

What happened?

Where is the problem? - Not sure, still exploring about

So...
Well, I'm using canary-main (exactly as is, with no changes to the source) - It's worth mentioning this.

In a scenario where I'm only creating (a custom map) - (32372, 33143, 7).

As we can see in the image, I only have one barrier between the player and monsters. and I get these errors in the distro. I've used canary-main in an older version with 150+ Players online, and I had the same problem. This was unreal because it significantly increases the number of logs in my .ext - I never found a solution for this other than committing part of this log in my source (I don't know if this caused a CPU problem).

Since I didn't find a solution, I'll be posting it here in case someone else is also going through this and we can reach some conclusion.

NOTE: I have no items, no imbuements, no wheels, no boosts or anything like that. Just a test map.
false-positive

What OS are you seeing the problem on?

Linux, Windows

Code of Conduct

  • I agree to follow this project's Code of Conduct
@helenarubra helenarubra added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Sep 5, 2024
@github-actions github-actions bot added Priority: Low Minor impact Status: Pending Test This PR or Issue requires more testing labels Sep 5, 2024
@luanluciano93
Copy link
Contributor

luanluciano93 commented Sep 6, 2024

Your error message comes from here:

g_logger().error("[{}] Combat type {} is out of range", __FUNCTION__, fmt::underlying(combatType));

Your problem is that you are using a combatType greater than or equal to COMBAT_COUNT on the server.

Here you can see the size of the combatTypes list:

enum CombatType_t : uint8_t {
COMBAT_PHYSICALDAMAGE = 0,
COMBAT_ENERGYDAMAGE = 1,
COMBAT_EARTHDAMAGE = 2,
COMBAT_FIREDAMAGE = 3,
COMBAT_UNDEFINEDDAMAGE = 4,
COMBAT_LIFEDRAIN = 5,
COMBAT_MANADRAIN = 6,
COMBAT_HEALING = 7,
COMBAT_DROWNDAMAGE = 8,
COMBAT_ICEDAMAGE = 9,
COMBAT_HOLYDAMAGE = 10,
COMBAT_DEATHDAMAGE = 11,
COMBAT_AGONYDAMAGE = 12,
COMBAT_NEUTRALDAMAGE = 13,
COMBAT_COUNT = 14,

I tested it on canary main, and no errors!

image

@helenarubra
Copy link
Author

Well, I didn't have anything modified in my project, I just used git clone, and ran it.
What I realized is that you test in different map locations like in Thais, how you do it, it doesn't really apply or error.
As if there was some kind of more specific scenario.
Also note that I am using original monsters that already exist in the canary, I will be exploring this further.

@luanluciano93
Copy link
Contributor

Bem, eu não tinha nada modificado no meu projeto, eu só usei git clone, e o executei. O que eu percebi é que você testa em diferentes locais do mapa como em Thais, como você faz, isso realmente não se aplica ou dá erro. Como se houvesse algum tipo de cenário mais específico. Note também que eu estou usando monstros originais que já existem no canary, eu vou explorar isso mais a fundo.

are you using canary main (last commit September 5, 2024) or are you using canary release (version 3.1.2)?

@philippelo
Copy link

It would be interesting to put it in the logger to show exactly which combat or xml or monster is having a specific problem

@murilo09 murilo09 removed the Status: Pending Test This PR or Issue requires more testing label Sep 8, 2024
@FelipePaluco
Copy link
Contributor

In fact this happen. Even with combats inside the size of combatTypes - Not sure what is causing yet, trying to figure out with some samples that i have.

@Risk-CPU
Copy link

Well, I didn't have anything modified in my project, I just used git clone, and ran it. What I realized is that you test in different map locations like in Thais, how you do it, it doesn't really apply or error. As if there was some kind of more specific scenario. Also note that I am using original monsters that already exist in the canary, I will be exploring this further.

Had the same issue few months ago, it's the map issue, can't remember exacly what was it. To solve my problem i had to remove some items from the map and it stopped.

@FelipePaluco
Copy link
Contributor

Still having the issue, i didn't know to track, sometime happens, sometimes not. If the player is hunting sometimes can happen.

@dudantas
Copy link
Member

dudantas commented Nov 10, 2024

Try the following pull request: #3095

It will help us find the problem, since we will know which line is calling the function, so I can fix it. When the error returns again, send me the log here so I can fix it, if some function is crashing or calling the conversion to index incorrectly.

@FelipePaluco @Risk-CPU @philippelo

Note: the pull request will not address the problem, just provide more details, knowing where it is calling and causing the error, I will be able to fix it.

@FelipePaluco
Copy link
Contributor

FelipePaluco commented Nov 11, 2024

@dudantas The problem it's related to isImunne of monster.cpp - Already tracked. By some reason, ocasionally, monsters can receive a combat type of 255 - which is outside the enum index. I've tested with some Demons and Infernal Demons, playing as a MS 1340 - Full SET - Throwing Avalanche (which the creatures are not immune) and dealing around 1k~1.3k damage per turn.

Notice that this can happen even with other monsters, as this is more generic than specific for a unique monster.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Minor impact Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
7 participants