X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FConsoleCmds.cpp;h=32e9c1cb6a8a3f174f48a52bb39a2177c53c14e1;hb=1f3a04488655b851cb12cf3d4d331577b896de3f;hp=279efb6dfe4e84b5005ae8cd24645a7ff911a148;hpb=b37c82db3e3baee0425f35e2183c8ccff6e9ebe7;p=lugaru.git diff --git a/Source/ConsoleCmds.cpp b/Source/ConsoleCmds.cpp index 279efb6..32e9c1c 100644 --- a/Source/ConsoleCmds.cpp +++ b/Source/ConsoleCmds.cpp @@ -1,5 +1,6 @@ /* Copyright (C) 2003, 2010 - Wolfire Games +Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file) This file is part of Lugaru. @@ -69,6 +70,8 @@ extern float viewdistance; extern int whichlevel; +float tintr = 1, tintg = 1, tintb = 1; + /* Helpers used in console commands */ /* Return true if PFX is a prefix of STR (case-insensitive). */ @@ -140,15 +143,17 @@ static void set_clothes(int pnum, const char *args) char buf[64]; snprintf(buf, 63, ":Data:Textures:%s.png", args); - if (!AddClothes(buf, &Person::players[pnum]->skeleton.skinText[pnum])) + int id = Person::players[pnum]->numclothes; + strcpy(Person::players[pnum]->clothes[id], buf); + Person::players[pnum]->clothestintr[id] = tintr; + Person::players[pnum]->clothestintg[id] = tintg; + Person::players[pnum]->clothestintb[id] = tintb; + Person::players[pnum]->numclothes++; + + if (!Person::players[pnum]->addClothes(id)) return; Person::players[pnum]->DoMipmaps(); - strcpy(Person::players[pnum]->clothes[Person::players[pnum]->numclothes], buf); - Person::players[pnum]->clothestintr[Person::players[pnum]->numclothes] = tintr; - Person::players[pnum]->clothestintg[Person::players[pnum]->numclothes] = tintg; - Person::players[pnum]->clothestintb[Person::players[pnum]->numclothes] = tintb; - Person::players[pnum]->numclothes++; } /* Console commands themselves */