ID:2237697
 
Code:
/obj/item/weapon/gun/projectile/bolt-action/
name = "bolt-action rifle"
desc = "A bolt-action rifle of true ww2 "
icon_state = "mosin"
item_state = "mosin" //placeholder
w_class = 4
force = 10
max_shells = 5
slot_flags = SLOT_BACK
origin_tech = "combat=4;materials=2;syndicate=8"
caliber = "a792x54"
recoil = 1 //extra kickback
//fire_sound = 'sound/weapons/sniper.ogg'
handle_casings = HOLD_CASINGS
load_method = SINGLE_CASING | SPEEDLOADER
max_shells = 1
ammo_type = /obj/item/ammo_casing/a762x54
magazine_type = /obj/item/ammo_magazine/mosin
//+2 accuracy over the LWAP because only one shot
accuracy = 1
scoped_accuracy = 2
var/bolt_open = 0

/obj/item/weapon/gun/projectile/bolt-action/update_icon()
if(bolt_open)
icon_state = "heavysniper-open"
else
icon_state = "heavysniper"

/obj/item/weapon/gun/projectile/bolt-action/attack_self(mob/user as mob)
playsound(src.loc, 'sound/weapons/flipblade.ogg', 50, 1)
bolt_open = !bolt_open
if(bolt_open)
if(chambered)
user << "<span class='notice'>You work the bolt open, ejecting [chambered]!</span>"
chambered.loc = get_turf(src)
loaded -= chambered
chambered = null
else
user << "<span class='notice'>You work the bolt open.</span>"
else
user << "<span class='notice'>You work the bolt closed.</span>"
bolt_open = 0
add_fingerprint(user)
update_icon()

/obj/item/weapon/gun/projectile/bolt-action/special_check(mob/user)
if(bolt_open)
user << "<span class='warning'>You can't fire [src] while the bolt is open!</span>"
return 0
return ..()

/obj/item/weapon/gun/projectile/bolt-action/load_ammo(var/obj/item/A, mob/user)
if(!bolt_open)
return
..()

/obj/item/weapon/gun/projectile/bolt-action/unload_ammo(mob/user, var/allow_dump=1)
if(!bolt_open)
return
..()






Problem description:
It gives error "code\modules\projectiles\guns\projectile\bolt-action.dm:32:e rror: bad argument definition", howewer, in other file there is similar code only with with /obj/item/weapon/gun/projectile/heavysniper instead of /obj/item/weapon/gun/projectile/bolt-action.
You can't have dashes in a type. "bolt-action" should be "bolt_action" instead.
In response to Kaiochao
Oh god, just figured out this myself. Thanks anyway!