18 lines
421 B
C
18 lines
421 B
C
#include "weapons.h"
|
|
#include <stddef.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
struct gun *init_gun(char name[50], int damage, enum distance range, int magazine_size){
|
|
|
|
struct gun *rslt = malloc(sizeof( struct gun));
|
|
//mettre protection
|
|
|
|
//init des var du struct
|
|
strcpy(rslt->name, name);
|
|
rslt->damage = damage;
|
|
rslt->range = range;
|
|
rslt->magazine_size = magazine_size;
|
|
|
|
return rslt;
|
|
}
|