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

Bug. Error registering an item in a previously uploaded category. #132

Open
IL0co opened this issue Apr 25, 2022 · 1 comment
Open

Bug. Error registering an item in a previously uploaded category. #132

IL0co opened this issue Apr 25, 2022 · 1 comment
Labels

Comments

@IL0co
Copy link
Collaborator

IL0co commented Apr 25, 2022

Describe the bug
Due to the fact that the category is badly unloaded, it deletes all handles behind itself. And if you register an item in this category again, then an error will be thrown due to invalid handles.

Module for testing.
shop_test.txt

To Reproduce
Steps to reproduce the behavior:

  1. Reload the shop. (not necessary)
  2. Load my module for testing (sm plugin load).
  3. Reload the module for testing (sm plugins reload).
  4. Get an error.

Server (please complete the following information):

  • OS: Windows (local test server)
  • Sourcemod version: 1.10.0.6528
  • Shop Version: 3.0E4

Console Log

	# I reload the shop to clear it.
] sm plugins reload shop
[Shop] Trying to connect!
[SM] Plugin [Shop] Core reloaded successfully.
 [Shop] Ваши данные магазина были загружены! Введите в чате !shop для доступа к магазину!

	# Loading my module.
] sm plugins load shop_test
Created new category
[SM] Loaded plugin shop_test.smx successfully.
 [Shop] Ваши данные магазина были загружены! Введите в чате !shop для доступа к магазину!
	# Shop loaded normally.

	# I reload my module, the module found an already created category and tries to register an item in it and an error pops up.
] sm plugins reload shop_test
Category founded
L 04/25/2022 - 22:34:49: [SM] Exception reported: Invalid Handle 0 (error 4)
L 04/25/2022 - 22:34:49: [SM] Blaming: shop.smx
L 04/25/2022 - 22:34:49: [SM] Call stack trace:
L 04/25/2022 - 22:34:49: [SM]   [0] StringMap.GetValue
L 04/25/2022 - 22:34:49: [SM]   [1] Line 364, c:\mygithub\Shop-Core\addons\sourcemod\scripting\shop/item_manager.sp::ItemManager_StartItem
L 04/25/2022 - 22:34:49: [SM]   [3] Shop_StartItem
L 04/25/2022 - 22:34:49: [SM]   [4] Line 29, d:\scripting\shop_test.sp::Shop_Started
L 04/25/2022 - 22:34:49: [SM]   [5] Line 14, d:\scripting\shop_test.sp::OnPluginStart
[SM] Plugin shop_test.smx failed to reload: Error detected in plugin startup (see error logs).
@Truyn

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants