lol, that changes everything. Thought you were using STRING* instead of char*.
then, str_create and str_cpy are of course the wrong functions to use. you'll have to use sys_malloc to assign memory space to those char*. you can then copy content into them with the standard c function strcpy, but be aware of buffer overflows that can happen very easily.


The question is: What do you actually want to do with this? If you want to speed things up, you should make another struct that encodes all possible block types and move some of the struct members to that:

Code:
typedef struct
{
	var typus;
	var obj_rotatealpha;
	STRING* objektname;			//The name of the Block
	STRING* filename;			//The filename of the Block
	STRING* setupname;			//The filename of the PAK file of the Block
	STRING* contentname;		//The name of the WRS file the block is located in
} BLOCK_TYPE;

typedef struct
{ 
        var block_type_id;                      // points to an index in a BLOCK_TYPE array
	var locked;					//Switch if a block is placed or not
	var team;					//Wich Team is the block owner (MP)
	var passable;				//Is the block passable or not?
	var explored;				//Is there fog of war or not?
	var positionx;				//The 3 block positions in this struct array
	var positiony;
	var positionz;
	var obj_pan;				//The object PAN rotation
	ENTITY* obj;				//The Block object itself
} BLOCK;



You could still load the BLOCK_TYPE list from a file, making it moddable.
Another advantage would be a lot less memory usage, and you could save the blocks into a binary file with file_save/file_load or file_asc_read/file_asc_write.

Last edited by SchokoKeks; 06/28/12 23:16. Reason: changed char* to STRING* in struct