stujones11 / shooter

First Person Shooter Mod for Minetest
Other
30 stars 18 forks source link

Prefer arrow in next slot of the crossbow #5

Closed lightonflux closed 9 years ago

lightonflux commented 9 years ago

As discussed in issue #2.

Here a mod that has this behaviour, but it only uses arrows in the next slot there is no "auto" loading like in shooter.

stujones11 commented 9 years ago

Thanks, this will act as a reminder for me to get that done, hopefully over the coming weekend when I have more time. I will, however be keeping the "auto" loading feature as that is more in-keeping with other features of this mod.

stujones11 commented 9 years ago

Well that was not so difficult, I think I have it working now the same as the mod you linked. If you are happy with this I can close the issue.

Edit: I've now added the missing reload sound when loading from the prefered slot.

HybridDog commented 9 years ago

now l get an error:

21:38:00: WARNING: Undeclared global variable "dye" accessed at ~/.minetest/mods/shooter/crossbow.lua:166 21:38:00: ERROR[main]: ========== ERROR FROM LUA =========== 21:38:00: ERROR[main]: Failed to load and run script from 21:38:00: ERROR[main]: ~/.minetest/mods/shooter/init.lua: 21:38:00: ERROR[main]: ~/.minetest/mods/shooter/crossbow.lua:166: attempt to index global 'dye' (a nil value) 21:38:00: ERROR[main]: stack traceback: 21:38:00: ERROR[main]: ~/.minetest/mods/shooter/crossbow.lua:166: in main chunk 21:38:00: ERROR[main]: [C]: in function 'dofile' 21:38:00: ERROR[main]: ~/.minetest/mods/shooter/init.lua:6: in main chunk 21:38:00: ERROR[main]: ======= END OF ERROR FROM LUA ======== 21:38:00: ERROR[main]: Server: Failed to load and run ~/.minetest/mods/shooter/init.lua 21:38:00: ERROR[main]: ModError: ModError: Failed to load and run ~/.minetest/mods/shooter/init.lua AL lib: FreeContext: (0xa21db38) Deleting 1 Source(s)

stujones11 commented 9 years ago

Are you by any chance using a different dye mod from the one in mt game? Otherwise I'd say that might be a bug in core because this mod depends on dye which should always be loaded first. Either way, I'm just gonna hardcode the color table to save this kind of crap from happening.

Thanks for letting me know.

HybridDog commented 9 years ago

l guess the error appears because l use an older minetest_game.

stujones11 commented 9 years ago

That would explain it for sure, hopefully my last commit should fix this for most versions.

HybridDog commented 9 years ago

thanks