Finish cargo bay door. Copy/paste of smart tile info.

This commit is contained in:
stevenhowes
2021-05-12 21:11:42 +01:00
parent 011983d960
commit 002b3562f8
4 changed files with 24 additions and 2 deletions
Binary file not shown.
+24 -2
View File
@@ -157,7 +157,7 @@ void game2_savesmarttiles(char* filename)
}
void game2_getnewsmarttile()
int game2_getnewsmarttile()
{
int i;
for(i = 0; i < SMARTTILES; i++)
@@ -167,9 +167,14 @@ void game2_getnewsmarttile()
SmartTiles[i].Tile = TilePlayer.rawtile;
SmartTiles[i].Action = 0;
SmartTiles[i].ActionValue = 0;
return;
return i;
}
}
screen_nobuffer();
printf("Couldn't allocate new spart tile.");
exit(0);
return -1;
}
void game2_loadmap(char* filename)
@@ -252,6 +257,8 @@ void game2_tick_input()
{
int x,y;
int oldselectedsmart;
int i,tmptileid;
oldselectedsmart = selectedsmart;
if(editsmart == 1)
{
@@ -468,6 +475,21 @@ void game2_tick_input()
if(tick > readmodkey)
{
fullmap[TilePlayer.rawtile] = clipboard;
for(i = 0; i < SMARTTILES; i++)
{
if(SmartTiles[i].Tile == clipboard_tileid)
{
tmptileid = game2_getnewsmarttile();
if(tmptileid > -1)
{
SmartTiles[tmptileid].ActionTarget = SmartTiles[i].ActionTarget;
SmartTiles[tmptileid].Action = SmartTiles[i].Action;
SmartTiles[tmptileid].ActionValue = SmartTiles[i].ActionValue;
}
}
}
readmodkey = tick + 10;
}
}
Binary file not shown.
Binary file not shown.