mirror of
https://github.com/UberGames/rpgxEF.git
synced 2024-11-10 07:11:34 +00:00
Bugfix
Added a missing malloc
This commit is contained in:
parent
b58d94864d
commit
f8d1bd2419
3 changed files with 10 additions and 4 deletions
|
@ -513,6 +513,7 @@ list_iter_p iterTimedMessages;
|
|||
static char *TimedMessage( void ){
|
||||
char* message;
|
||||
timedMessage_t *msg;
|
||||
container_p c;
|
||||
|
||||
if(!level.timedMessages->length) {
|
||||
return "^1RPG-X ERROR: No messages to display";
|
||||
|
@ -525,7 +526,8 @@ static char *TimedMessage( void ){
|
|||
}
|
||||
}
|
||||
|
||||
msg = (timedMessage_t *)list_cycl_next(iterTimedMessages)->data;
|
||||
c = list_cycl_next(iterTimedMessages);
|
||||
msg = c->data;
|
||||
message = msg->message;
|
||||
|
||||
return message;
|
||||
|
|
|
@ -7438,6 +7438,7 @@ typedef struct rShader_s {
|
|||
void addShaderToList(list_p list, char *shader) {
|
||||
rShader_s* s = (rShader_s *)malloc(sizeof(rShader_s));
|
||||
rShader_s* t;
|
||||
container_p c;
|
||||
list_iter_p i;
|
||||
|
||||
if(s == NULL) return;
|
||||
|
@ -7457,7 +7458,8 @@ void addShaderToList(list_p list, char *shader) {
|
|||
return;
|
||||
}
|
||||
|
||||
for(t = (rShader_s *)list_next(i)->data; t != NULL; t = (rShader_s *)list_next(i)->data) {
|
||||
for(c = list_next(i)->data; c != NULL; c = list_next(i)->data) {
|
||||
t = c->data;
|
||||
if(!strcmp(shader, t->s)) {
|
||||
return;
|
||||
}
|
||||
|
@ -7476,6 +7478,7 @@ void Cmd_GeneratePrecacheFile(gentity_t *ent) {
|
|||
qboolean first = qtrue;
|
||||
fileHandle_t f;
|
||||
rShader_s* s;
|
||||
container_p c;
|
||||
|
||||
trap_GetServerinfo(info, MAX_INFO_STRING);
|
||||
Com_sprintf(file, MAX_QPATH, "maps/%s.precache", Info_ValueForKey(info, "mapname"));
|
||||
|
@ -7526,7 +7529,8 @@ void Cmd_GeneratePrecacheFile(gentity_t *ent) {
|
|||
return;
|
||||
}
|
||||
|
||||
for(s = (rShader_s *)list_next(iter)->data; s != NULL; s = (rShader_s *)list_next(iter)->data) {
|
||||
for(c = list_next(iter)->data; c != NULL; c = list_next(iter)->data) {
|
||||
s = c->data;
|
||||
G_Printf("\t%s\n", s->s);
|
||||
if(first) {
|
||||
trap_FS_Write("\"", 1, f);
|
||||
|
|
|
@ -61,7 +61,7 @@ list_iter_p list_iterator(list_p list, char init) {
|
|||
int list_add(list_p list, void* data, dataType_t type, size_t size, char end) {
|
||||
lnode_p node = (lnode_p)malloc(sizeof(struct linked_node));
|
||||
|
||||
node->cont = (container_p)(sizeof(container));
|
||||
node->cont = (container_p)malloc(sizeof(container));
|
||||
if(node->cont == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue