Chessnut / NutScript

A free role-play framework for Garry's Mod.
http://nutscript.rocks
MIT License
94 stars 77 forks source link

[1.1]Weapon ammo isn't saved on server restart #553

Closed koen24 closed 9 years ago

koen24 commented 9 years ago

Whenever ammo is loaded (and not in a gun's first clip), it will dissappear when the server restarts.

Chessnut commented 9 years ago

Duplicate of #472

koen24 commented 9 years ago

It isn't the same issue. #472 only regards the first clip of ammo (the amount that's already loaded into the gun) Imagine I have a revolver. I load a box of 12 rounds and load my gun. The revolver would have 6 rounds in it and 6 extra rounds. With this issue, it's the extra rounds that disappear, not the rounds that have already been loaded into the gun. Besides, #472 occurs when the player respawns, or the character is reloaded. This bug only occurs whenever the server is restarted.

Chessnut commented 9 years ago

Well if the issue is when the server is restarted, it seems like it is not a clean restart as the CharacterPreSave hook is not being ran.

koen24 commented 9 years ago

Just repeated my steps on a clean install of both nutscript and the hl2rp schema and made sure I shut down the server properly by typing 'quit' in the console, but the issue persists.

Thadah commented 9 years ago

Confirming.

Steps to reproduce:

  1. Spawn a vendor
  2. Buy gun and buy ammo
  3. Equip gun and load ammo
  4. Shoot once
  5. Reload the gun (to change the amount on the secondary magazine mostly)
  6. quit the server

When restarting the server and going in, only first clip is full, the extra ammo is gone.

Chessnut commented 9 years ago

So I got that fixed, but for some reason the remaining ammo won't save. For some reason, setting the ammo count won't stay.