Skip to content

Commit

Permalink
Check ID on texture import
Browse files Browse the repository at this point in the history
Another check to see if the material is being set to the last object created
  • Loading branch information
Crayder committed Feb 20, 2018
1 parent 10bc73b commit 3e932e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Binary file modified filterscripts/tstudio.amx
Binary file not shown.
13 changes: 11 additions & 2 deletions filterscripts/tstudio/tsmain.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -2455,7 +2455,7 @@ ImportMap(playerid)
new item[40], itype;
new line[1024];
new fcount;
new templast;
new templast, templastid[32];
new tmp[16];
new tmpobject[OBJECTINFO];
new tmpremove[REMOVEINFO];
Expand Down Expand Up @@ -2500,7 +2500,13 @@ ImportMap(playerid)
else if(strfind(templine, "SetObjectMaterial(", true) != -1) type = 4;
else if(strfind(templine, "SetDynamicObjectMaterial(", true) != -1) type = 5;
else continue;


new assignment = strfind(templine, "=");
if(assignment != -1) {
strmid(templastid, templine, 0, assignment);
strtrim(templastid);
}

strmid(templine, templine, strfind(templine, "(") + 1, strfind(templine, ");"), sizeof(templine));

if(type == 1 || type == 2)
Expand Down Expand Up @@ -2530,6 +2536,9 @@ ImportMap(playerid)
if(sscanf(templine, "p<,>s[16]iis[32]s[32]h", tmp, tempindex, tempmodel, temptxd, temptexture, tempcolor))
continue;

if(strcmp(tmp, templastid)) // Stuff before '=' doesn't equal stuff in first param
continue;

ObjectData[templast][oColorIndex][tempindex] = tempcolor;
for(new i = 0; i < sizeof(ObjectTextures); i++)
{
Expand Down

0 comments on commit 3e932e5

Please sign in to comment.