Guild icon
Teeworlds
discord.gg/teeworlds / general
Teeworlds Discord Server.
Between 2018-10-22 00:00:00Z and 2018-10-23 00:00:00Z
Avatar
0.7 just keeps getting worse for modders
05:36
in 0.6 it used to be that m_armor and m_health were clamped
05:36
case NETOBJTYPE_CHARACTER: { CNetObj_Character *pObj = (CNetObj_Character *)pData; if(sizeof(*pObj) != Size) return -1; pObj->m_PlayerFlags = ClampInt("m_PlayerFlags", pObj->m_PlayerFlags, 0, 256); pObj->m_Health = ClampInt("m_Health", pObj->m_Health, 0, 10); pObj->m_Armor = ClampInt("m_Armor", pObj->m_Armor, 0, 10); pObj->m_AmmoCount = ClampInt("m_AmmoCount", pObj->m_AmmoCount, 0, 10); pObj->m_Weapon = ClampInt("m_Weapon", pObj->m_Weapon, 0, NUM_WEAPONS-1); pObj->m_Emote = ClampInt("m_Emote", pObj->m_Emote, 0, 6); pObj->m_AttackTick = ClampInt("m_AttackTick", pObj->m_AttackTick, 0, max_int); return 0; }
05:38
now in 0.7 if you have a mod where health or armour is above or below 0 the character is discarded
05:38
case NETOBJTYPE_CHARACTER: { CNetObj_Character *pObj = (CNetObj_Character *)pData; if(sizeof(*pObj) != Size) return -1; if(!CheckInt("m_Health", pObj->m_Health, 0, 10)) return -1; if(!CheckInt("m_Armor", pObj->m_Armor, 0, 10)) return -1; if(!CheckInt("m_Weapon", pObj->m_Weapon, 0, NUM_WEAPONS-1)) return -1; if(!CheckInt("m_Emote", pObj->m_Emote, 0, 6)) return -1; if(!CheckInt("m_AttackTick", pObj->m_AttackTick, 0, max_int)) return -1; if(!CheckFlag("m_TriggeredEvents", pObj->m_TriggeredEvents, COREEVENTFLAG_GROUND_JUMP|COREEVENTFLAG_AIR_JUMP|COREEVENTFLAG_HOOK_ATTACH_PLAYER|COREEVENTFLAG_HOOK_ATTACH_GROUND|COREEVENTFLAG_HOOK_HIT_NOHOOK)) return -1; return 0; }
05:38
@heinrich5991 commented on 6 Apr 2014 matricks said that the objects containing integers out of range should simply be discarded.
05:39
@fokkonaut this is why your invisible on ur ddnet mod if ur frozen more than 3 seconds
Avatar
+1, this problem was causing weird bugs on my fng mod until @ZombieToad figured this out
05:41
And yes, 0.7 is just bad for modding, oy wanted it like this
05:43
@ZombieToad which file is it?
Avatar
@fokkonaut character.cpp
05:46
i think
05:46
m_Armor=(m_FreezeTime >= 0)?10-(m_FreezeTime/15):0;
Avatar
ah ye, that line
05:48
Whats the smartest way to fix it?
Avatar
without commenting it out xD
Avatar
m_Armor=(m_FreezeTime >= 0 && m_FreezeTime <= 150)?10-(m_FreezeTime/15):0;
05:50
this might work
Avatar
Will try it later, thanks :)
Avatar
(commenting it out fixed it for me except armor always stays at 10/10, i didnt see this as a problem)
Avatar
i know that this will set it to always 10
05:59
but i didnt want that xd
Spurde joined the server. 2018-10-22 07:16:25Z
Exported 25 message(s)