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

[Doors] Fix issue where NPC's wouldn't open doors because door param overflow #2934

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

Akkadius
Copy link
Member

What

This fixes a datatype issue preventing NPC's from being able to open doors because their AI logic checks for door_param > 0 then don't open door.

Because -1 or sub-zero values are being loaded into an unsigned integer, this is overflowing those values into positives causing the discrepancy in behavior.

Tested and fixed, in Griegs End, all doors are -1

door-open-fix.mp4
select count(*) as count, door_param from doors group by door_param having count > 10;
+-------+------------+
| count | door_param |
+-------+------------+
|    54 |         -3 |
|  7497 |         -1 |
|  8032 |          0 |
|   125 |          1 |
|    22 |          2 |
|    83 |          5 |
|   109 |          6 |
|    33 |          7 |
|    31 |          9 |
|   267 |         10 |
|    85 |         11 |
|   114 |         12 |
|   107 |         13 |
|    97 |         14 |
|    55 |         15 |
|   140 |         16 |
|    18 |         17 |
|    11 |         20 |
|    83 |         23 |
|    11 |         24 |
|    12 |         25 |
|    18 |         30 |
|    11 |         32 |
|    15 |         64 |
|    21 |         65 |
|    13 |         66 |
|    14 |         67 |
|    11 |         70 |
|    62 |        100 |
|    18 |        101 |
|    22 |        102 |
|   172 |        103 |
|    99 |        104 |
|   152 |        105 |
|    23 |        112 |
|    52 |        116 |
|    14 |        120 |
|    42 |        122 |
|    13 |        128 |
|   622 |        132 |
|    23 |        142 |
|    19 |        145 |
|    13 |        190 |
|   105 |       1500 |
+-------+------------+
44 rows in set (0.00 sec)

@Akkadius
Copy link
Member Author

cc @noudess

@Akkadius Akkadius merged commit 0829bc0 into master Feb 15, 2023
@Akkadius Akkadius deleted the akkadius/doors-param-fix branch February 15, 2023 16:59
@Akkadius Akkadius mentioned this pull request Feb 16, 2023
catapultam-habeo pushed a commit to catapultam-habeo/pyrelight-server that referenced this pull request Mar 27, 2023
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

Successfully merging this pull request may close these issues.

2 participants