05:17 <+bridge_> [ddnet] Is there a particular reason for keeping the behavior that, when turning on cl_dummy_control, holding down cl_dummy_hammer and then only on the *release* causes the dummy to repeat the fire command, as well as jump and hook if they are turned on with cl_dummy_jump/cl_dummy_hook or held down through other methods? 05:17 <+bridge_> [ddnet] is this behavior necessary exactly? 05:20 <+bridge_> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/971974599178866688/2022-05-05_23-19-13.mp4 05:20 <+bridge_> [ddnet] it causes behaviors like that. 05:21 <+bridge_> [ddnet] I just want to know other's opinion on it. perhaps we can start a petition to get it changed or not, as it can be used as a tech. It's just everything that this tech achieves can also be achieved if it is "fixed" regardless 05:23 <+bridge_> [ddnet] And the tech actually doesnt even use cl_dummy_control, so nevermind. 05:24 <+bridge_> [ddnet] I'd be ok if on release, jump, hook or fire are activated (if they are turned "on"), but if they ARENT, such as in the case of fire, it shouldn't happen in my opinion. 05:24 <+bridge_> [ddnet] therefore the only thing it would change is what is shown in the video 05:32 <+bridge_> [ddnet] sorry for the spam but, to be perfectly clear, the only change I would want is that on release of cl_dummy_hammer, the dummy will then hammer where he is looking (assuming he CAN hammer, after the usual delay of course), which he does EVERY TIME no matter what. I don't think this behavior is necessary. 05:33 <+bridge_> [ddnet] if it is changed to act like cl_dummy_hammer WITHOUT cl_dummy_control turned on, in my opinion that would be perfect. But that is not the case currently. 05:37 <+bridge_> [ddnet] The ONLY way to combat it is if you activate cl_dummy_hammer and *release* the key in less than 120 ms, which is very hard. 06:14 <+bridge_> [ddnet] <🆘🅰> thats brazy 11:29 <+bridge_> [ddnet] Was it really intended that we don't hold input when chat is closed now?\ 11:39 <+bridge_> [ddnet] i remember when i opened a pr for that deen said its unwanted 11:49 <+bridge_> [ddnet] if you ever wanted to make ur own language but the lexer stuff is bothersome 11:49 <+bridge_> [ddnet] https://pest.rs/ 11:49 <+bridge_> [ddnet] is awesome xd 11:49 <+bridge_> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/972072620029800458/unknown.png 11:49 <+bridge_> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/972072657346506762/unknown.png 11:49 <+bridge_> [ddnet] poggers 11:49 <+bridge_> [ddnet] ryolang incoming 11:49 <+bridge_> [ddnet] totally not inspired by rust 12:25 <+bridge_> [ddnet] why no argument type in function definition? rust requires it right? 12:25 <+bridge_> [ddnet] like why does rust require it and your language doesn't 12:37 <+bridge_> [ddnet] because thats complex 12:37 <+bridge_> [ddnet] i never did aa language before 12:37 <+bridge_> [ddnet] im just testing stuff xd 12:37 <+bridge_> [ddnet] i just want to get to the part where i generate llvm ir 12:41 <+bridge_> [ddnet] ah ok i thought it was gonna be a feature of the language xd 12:49 <+bridge_> [ddnet] you are speaking about cl_dummy_hammer overwrites cl_dummy_control? right? 12:54 <+bridge_> [ddnet] I just tested it, for me the dummy just makes normal hammerfly xD what else do you have set 13:35 <+bridge_> [ddnet] Hey, so i wanted to change the source code, so that when you hook a hook-able tile, the hook gets automatically released like when you hook a player. What i did is in gamecore.ccp, i copied the like that seems to be responsible for the player release mechanic and removed everything where it says player. This seams to work, but sadly cos its in gamecore.ccp i have to use the compiled client as well, or i get some strange prediction bugs. 13:59 <+bridge_> [ddnet] you could also just make a block that is only hookable for a short time that you can specify with the delay parameter in the switch layer 14:00 <+bridge_> [ddnet] you just have to make it so that it is diffrent from the normal mechanic so that it does not get misspredicted 14:01 <+bridge_> [ddnet] what i meant was this: when turning on dummy control, and hollding diwn the dummy hammer button, the tee automatically hammers you 14:02 <+bridge_> [ddnet] at a fixed rate designed for hammerfly. you get that? 14:02 <+bridge_> [ddnet] yes 14:02 <+bridge_> [ddnet] ok. and you get the delay for hammer is 120 ms 14:02 <+bridge_> [ddnet] but the delay for holding it down is like 459 or something idk 14:03 <+bridge_> [ddnet] cuz its hammering for hammerfly not as fast as it can 14:03 <+bridge_> [ddnet] for example add a new type of block here https://github.com/C0D3D3V/ddnet/blob/9dc2141ded307f013402e7d84c66bc793b45cc6c/src/game/gamecore.cpp#L247-L261 14:04 <+bridge_> [ddnet] what do you mean by holding it down? 14:04 <+bridge_> [ddnet] what is your bind? 14:04 <+bridge_> [ddnet] bind x +toggle cl_dummy_hammer 1 0 14:04 <+bridge_> [ddnet] holdig x down makes the tee hammer you every 800 ms basically so ethinglike that 14:04 <+bridge_> [ddnet] xD why would you hold it down 14:05 <+bridge_> [ddnet] im just saying 14:05 <+bridge_> [ddnet] lol if I hold it down it hammers instant 14:06 <+bridge_> [ddnet] anyway. if the tee misses you, the cooldownis 120 ms. if you@hold the button down, yes its instant, then wait 120 ms, then release, the dummy will then hame,r AGAIN where he is looking 14:06 <+bridge_> [ddnet] not at you, but where he is looking. 14:06 <+bridge_> [ddnet] test it and see that i am correct 14:09 <+bridge_> [ddnet] xD you would have to bind it to left and right and fire to even use it for something serious wouldn't you? 14:09 <+bridge_> [ddnet] what 14:10 <+bridge_> [ddnet] if I hold my hammerfly bind I can not use it to fly because as soon as I press A D or click it will stop instant hammer 14:11 <+bridge_> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/972108270661664788/dummy_hammer-2022-05-06_14.08.02.mp4 14:11 <+bridge_> [ddnet] um 14:11 <+bridge_> [ddnet] just bind x +toggle cl_dummy_hammer 1 0 14:12 <+bridge_> [ddnet] every time you press x he hammers in your direction 14:12 <+bridge_> [ddnet] what do you mean you cant move? 14:12 <+bridge_> [ddnet] you see in the video as soon as I press some other key while holding "x" it stopps spamming in the chat the bind 14:13 <+bridge_> [ddnet] ok but you have it bound wrong. just bind a random key to the command i sent 14:13 <+bridge_> [ddnet] then hold kt down, tne dummy should hammer every 800 ms or whatever 14:14 <+bridge_> [ddnet] u dont need cfgs for this 14:17 <+bridge_> [ddnet] if I do it with your bind it hammers just normal every 0.5sec so every 25 tick 14:17 <+bridge_> [ddnet] right ok. now turn on dummy control, and tap the key 14:17 <+bridge_> [ddnet] do you see that he does a double hammer? 14:18 <+bridge_> [ddnet] yes 14:19 <+bridge_> [ddnet] so what is happening there, is that you tap it, he hammers, and then while you still have the button down, 120 ms passes by, you release, and the act of releasing the key makes him hammer again, not at you but where he is looking 14:19 <+bridge_> [ddnet] this is what i want changed 14:19 <+bridge_> [ddnet] just remove that 14:22 <+bridge_> [ddnet] ah well that makes sense xd, aight gonna try to impliment that.. tho i am only what you would call a "script kiddy" xd as i basically just started to learn about modifying the source code.. but ya hope thats managable 😅 thank u anyway tho :) 14:24 <+bridge_> [ddnet] just tested it in DDNet-12.5 because I was sure it was not always like this... And I'm right. Its a bug that got introduced at one point 14:24 <+bridge_> [ddnet] ok. its a very annoying bug. could you make the move to remove it? i would greatly appreciate it. 14:25 <+bridge_> [ddnet] Won't make your prediction issue any easier though 14:26 <+bridge_> [ddnet] Sure xD but we could add the block to ddnet if we like the idea 14:27 <+bridge_> [ddnet] endles hook is no problem for vanilla because it does not predict the release I think 14:28 <+bridge_> [ddnet] I did take a look and I couldn't figure out any magic to fix the prediction, sorry 14:31 <+bridge_> [ddnet] what is the point of a block that only lasts a certain time? if you aim in the same direction you hook instant again? Do not understand what is wrong predicted. if the server says that your hook is retracted then the client should accept that without wrong prediction. Can you make a video? 14:32 <+bridge_> [ddnet] what is the point of a block on that the hook only lasts a certain time? if you aim in the same direction you hook instant again? Do not understand what is wrong predicted. if the server says that your hook is retracted then the client should accept that without wrong prediction. Can you make a video? 14:35 <+xq> Hey! There seems to be a few teamrecords which lack a teammate, as shown here: https://dpaste.org/KfoRv - It seems to happen to mostly asian players, such as 毅然, [D]sadrain and yewon. Unsure what the reason is, but I'm guessing their teamates rank got manually deleted for whatever reason? 14:46 <+bridge_> [ddnet] I want to modify the TeeSmash mod a bit, as i really like the gameplay, but most maps are made so that you cant hook any ground, because you could just hook the floor and prevent from getting hammerd off the map, so that change would be first step to make more engaging maps with more movement. https://youtu.be/va-DFrPs2-k here u see what happens when i don't use the compiled client (this is with ddnet) thing is also, that the prediction 14:49 <+bridge_> [ddnet] i am going to report my bug to #bugs 14:55 <+bridge_> [ddnet] what if you turn cl_predict off? 14:56 <+bridge_> [ddnet] would be better if you just open a issue so it does not get lost 14:57 <+bridge_> [ddnet] ok 14:59 <+bridge_> [ddnet] this looks more like a little prediction xD normaly the prediction should not be that far off the real data 14:59 <+bridge_> [ddnet] this looks more than a little prediction xD normaly the prediction should not be that far off the real data 14:59 <+bridge_> [ddnet] this looks more than a little prediction xD normally the prediction should not be that far off the real data 15:16 <+bridge_> [ddnet] does the same, but the game jitters xd 15:16 <+bridge_> [ddnet] ya idk.. also like i said its really strange that it works with "HOOK_IDLE" .. or almost works atleast xd 16:06 <+bridge_> [ddnet] Do any of you use sub-pixel rendering on Linux? Any idea why the lcdfilter would change font spacing? 16:15 <+bridge_> [ddnet] for a moment i read that name as cockstown 16:15 <+bridge_> [ddnet] xd 16:15 <+bridge_> [ddnet] @c0d3d3v i downloaded 12.5 and went to a server and the issue still perists. does it not work on servers? howd you test it 16:16 <+bridge_> [ddnet] i dunno about that filter directly, but too "high" hinting can cause spacing between characters 16:20 <+bridge_> [ddnet] I thought the hinting might be an issue aswell, but when I force "hintslight" on both the subpixel rendered version and the non-subpixel rendered version I get very different spacings still :/ 16:30 <+bridge_> [ddnet] xq: nice find, the ones between `2021-05-01` and `2021-08-01` are likely my fault, i'll fix that as soon as possible, not sure about the other ones though 17:14 <+bridge_> [ddnet] because you have hinting enabled? 17:15 <+bridge_> [ddnet] I wish I could get Linux font rendering on macOS, so much less blurry. Don't want to buy a 5k screen just because macOS has bad font rendering and only supports 2x resolutions well 17:49 <+bridge_> [ddnet] I've tried forcing hinting. There is a clear spacing difference between `xft:DejaVu Sans Mono:pixelsize=14:hintstyle=hintnone:rgba=rgb:lcdfilter=lcddefault` and `xft:DejaVu Sans Mono:pixelsize=14:hintstyle=hintnone` 17:52 <+bridge_> [ddnet] Even more damning the spacing is different between `lcddefault`, `lcdlight` and `lcdlegacy` 17:56 <+bridge_> [ddnet] Seems only lcddefault messes up the spacing 19:08 <+bridge_> [ddnet] Mh, my discord is very laggy aswell, I seem to have messed something up but can't figure out what 19:44 <+bridge_> [ddnet] I definitely seem to have fucked something up while setting this pc up, firefox and chrome both work much better in windows somehow 19:56 <+bridge_> [ddnet] well how much can go wrong xd 19:56 <+bridge_> [ddnet] just do some benchmarks and see what the bottleneck is 20:09 <+bridge_> [ddnet] u compiled it in debug mode 20:09 <+bridge_> [ddnet] :troll: 20:33 <+bridge_> [ddnet] how to link an issue in a pr title? 20:34 <+bridge_> [ddnet] oh, i see the typo now, how the fuck does a typo can appear in a copy paste? 20:38 <+bridge_> [ddnet] ehm, how do you add a `.c` file that is not compiled to cmake? 20:39 <+bridge_> [ddnet] github is really annoying, when i link an issue it sometimes makes suggestions and pressing enter makes it use another issue then 20:40 <+bridge_> [ddnet] any idea on my second problem 😄 ? 20:40 <+bridge_> [ddnet] i dont understand xd 20:41 <+bridge_> [ddnet] if u dont want to compile it, name it .txt 20:41 <+bridge_> [ddnet] when i add the files confusables_data.c, it tries to compile them as standalone 20:41 <+bridge_> [ddnet] nah, it's still c files, but i dont want to name it `.h`, it would be confusing 20:43 <+bridge_> [ddnet] so u want to include it? 20:43 <+bridge_> [ddnet] it's an ugly workaround anyway 20:44 <+bridge_> [ddnet] i'd just use a .h i guess 20:44 <+bridge_> [ddnet] i don't know why the scripts themselves don't write on the file directly 20:45 <+bridge_> [ddnet] ok cant help u, bcs i dont really understand ur problem xD 21:57 <+bridge_> [ddnet] https://www.youtube.com/watch?v=8--5LwHRhjk @Not Keks bro wtf?? how can they fcking do that just with maths 21:57 <+bridge_> [ddnet] everything is math 21:59 <+bridge_> [ddnet] but yeah, insane guy 21:59 <+bridge_> [ddnet] 21:59 <+bridge_> [ddnet] probs working on disney tools or smth xd 22:44 <+bridge_> [ddnet] oh i LOVE shadertoy 22:45 <+bridge_> [ddnet] ex pixar guy 23:00 <+bridge_> [ddnet] i c, completly overpowered that guy ^^ 23:26 <+bridge_> [ddnet] can u guys add a pause camera move feature with arrow keys? 23:45 <+bridge_> [ddnet] Hi folks, what would you think about little more use of C++ for convenience and maybe less copy-paste mistakes? Now when we converted system to C++, and even require [0] C++17 [1] to build. 23:45 <+bridge_> [ddnet] 23:45 <+bridge_> [ddnet] [0] https://github.com/ddnet/ddnet/commit/843acf6a5a80ef445ff134c90bee374212673464 23:45 <+bridge_> [ddnet] [1] https://en.cppreference.com/w/cpp/iterator/size 23:45 <+bridge_> [ddnet] For example, we can add a `str_copy` version which 'll get the destination size automatically. 23:45 <+bridge_> [ddnet] 23:45 <+bridge_> [ddnet] ```diff 23:45 <+bridge_> [ddnet] diff --git src/base/system.h src/base/system.h 23:45 <+bridge_> [ddnet] index af617d7ad..133345376 100644 23:45 <+bridge_> [ddnet] --- src/base/system.h 23:45 <+bridge_> [ddnet] +++ src/base/system.h 23:45 <+bridge_> [ddnet] @@ -2423,6 +2423,13 @@ void set_exception_handler_log_file(const char *log_file_path); 23:45 <+bridge_> [ddnet] 23:45 <+bridge_> [ddnet] #if defined(__cplusplus) 23:46 <+bridge_> [ddnet] } 23:46 <+bridge_> [ddnet] + 23:46 <+bridge_> [ddnet] +template 23:46 <+bridge_> [ddnet] +int str_copy(char (&dst)[N], const char *src) 23:46 <+bridge_> [ddnet] +{ 23:46 <+bridge_> [ddnet] + str_copy(dst, src, N); 23:46 <+bridge_> [ddnet] +} 23:46 <+bridge_> [ddnet] + 23:46 <+bridge_> [ddnet] #endif 23:46 <+bridge_> [ddnet] 23:46 <+bridge_> [ddnet] #endif``` 23:46 <+bridge_> [ddnet] 23:46 <+bridge_> [ddnet] We have 477 uses of `str_copy`, mostly stuff like `str_copy(m_Password, pPassword, sizeof(m_Password));`, but sometimes even use hardcoded values: 23:46 <+bridge_> [ddnet] https://github.com/ddnet/ddnet/blob/e14fc102a6f5f4492ab1eb26504642181c6aa933/src/game/client/gameclient.cpp#L1196 23:47 <+bridge_> [ddnet] For example, we can add a `str_copy` version which 'll get the destination size automatically. 23:47 <+bridge_> [ddnet] 23:47 <+bridge_> [ddnet] ```diff 23:47 <+bridge_> [ddnet] diff --git src/base/system.h src/base/system.h 23:47 <+bridge_> [ddnet] index af617d7ad..133345376 100644 23:47 <+bridge_> [ddnet] --- src/base/system.h 23:47 <+bridge_> [ddnet] +++ src/base/system.h 23:47 <+bridge_> [ddnet] @@ -2423,6 +2423,13 @@ void set_exception_handler_log_file(const char *log_file_path); 23:47 <+bridge_> [ddnet] 23:47 <+bridge_> [ddnet] #if defined(__cplusplus) 23:47 <+bridge_> [ddnet] } 23:47 <+bridge_> [ddnet] + 23:47 <+bridge_> [ddnet] +template 23:47 <+bridge_> [ddnet] +int str_copy(char (&dst)[N], const char *src) 23:47 <+bridge_> [ddnet] +{ 23:47 <+bridge_> [ddnet] + str_copy(dst, src, N); 23:47 <+bridge_> [ddnet] +} 23:47 <+bridge_> [ddnet] + 23:47 <+bridge_> [ddnet] #endif 23:47 <+bridge_> [ddnet] 23:47 <+bridge_> [ddnet] #endif``` 23:47 <+bridge_> [ddnet] 23:47 <+bridge_> [ddnet] We have 477 uses of `str_copy`, mostly stuff like `str_copy(m_Password, pPassword, sizeof(m_Password));`, but sometimes even use hardcoded values: 23:47 <+bridge_> [ddnet] https://github.com/ddnet/ddnet/blob/e14fc102a6f5f4492ab1eb26504642181c6aa933/src/game/client/gameclient.cpp#L1196 23:47 <+bridge_> [ddnet] 23:47 <+bridge_> [ddnet] Eventually we can replace all `str_copy(a, b, sizeof(a))`, but for now I just suggest to add such functions. `str_copy` is not the only case. 23:48 <+bridge_> [ddnet] For example, we can add a `str_copy` version which 'll get the destination size automatically. 23:48 <+bridge_> [ddnet] 23:48 <+bridge_> [ddnet] ```diff 23:48 <+bridge_> [ddnet] diff --git src/base/system.h src/base/system.h 23:48 <+bridge_> [ddnet] index af617d7ad..133345376 100644 23:48 <+bridge_> [ddnet] --- src/base/system.h 23:48 <+bridge_> [ddnet] +++ src/base/system.h 23:48 <+bridge_> [ddnet] @@ -2423,6 +2423,13 @@ void set_exception_handler_log_file(const char *log_file_path); 23:48 <+bridge_> [ddnet] 23:48 <+bridge_> [ddnet] #if defined(__cplusplus) 23:48 <+bridge_> [ddnet] } 23:48 <+bridge_> [ddnet] + 23:48 <+bridge_> [ddnet] +template 23:48 <+bridge_> [ddnet] +int str_copy(char (&dst)[N], const char *src) 23:48 <+bridge_> [ddnet] +{ 23:48 <+bridge_> [ddnet] + str_copy(dst, src, N); 23:48 <+bridge_> [ddnet] +} 23:48 <+bridge_> [ddnet] + 23:48 <+bridge_> [ddnet] #endif 23:48 <+bridge_> [ddnet] 23:48 <+bridge_> [ddnet] #endif``` 23:48 <+bridge_> [ddnet] 23:48 <+bridge_> [ddnet] We have 477 uses of `str_copy`, mostly stuff like `str_copy(m_Password, pPassword, sizeof(m_Password));`, but sometimes even use hardcoded values: 23:49 <+bridge_> [ddnet] https://github.com/ddnet/ddnet/blob/e14fc102a6f5f4492ab1eb26504642181c6aa933/src/game/client/gameclient.cpp#L1196 23:49 <+bridge_> [ddnet] 23:49 <+bridge_> [ddnet] If we don't want to replace all cases (I think there are at least 300 uses like `str_copy(a, b, sizeof(a))`) then we can at least add such functions and use them in new code. 23:49 <+bridge_> [ddnet] And `str_copy` is not the only case, there are also 23:49 <+bridge_> [ddnet] For example, we can add a `str_copy` version which 'll get the destination size automatically. 23:49 <+bridge_> [ddnet] 23:49 <+bridge_> [ddnet] ```diff 23:49 <+bridge_> [ddnet] diff --git src/base/system.h src/base/system.h 23:49 <+bridge_> [ddnet] index af617d7ad..133345376 100644 23:49 <+bridge_> [ddnet] --- src/base/system.h 23:49 <+bridge_> [ddnet] +++ src/base/system.h 23:49 <+bridge_> [ddnet] @@ -2423,6 +2423,13 @@ void set_exception_handler_log_file(const char *log_file_path); 23:49 <+bridge_> [ddnet] 23:49 <+bridge_> [ddnet] #if defined(__cplusplus) 23:49 <+bridge_> [ddnet] } 23:49 <+bridge_> [ddnet] + 23:49 <+bridge_> [ddnet] +template 23:49 <+bridge_> [ddnet] +int str_copy(char (&dst)[N], const char *src) 23:49 <+bridge_> [ddnet] +{ 23:49 <+bridge_> [ddnet] + str_copy(dst, src, N); 23:49 <+bridge_> [ddnet] +} 23:49 <+bridge_> [ddnet] + 23:49 <+bridge_> [ddnet] #endif 23:49 <+bridge_> [ddnet] 23:49 <+bridge_> [ddnet] #endif``` 23:49 <+bridge_> [ddnet] 23:49 <+bridge_> [ddnet] We have 477 uses of `str_copy`, mostly stuff like `str_copy(m_Password, pPassword, sizeof(m_Password));`, but sometimes even use hardcoded values: 23:50 <+bridge_> [ddnet] https://github.com/ddnet/ddnet/blob/e14fc102a6f5f4492ab1eb26504642181c6aa933/src/game/client/gameclient.cpp#L1196 23:50 <+bridge_> [ddnet] 23:51 <+bridge_> [ddnet] For example, we can add a `str_copy` version which 'll get the destination size automatically. 23:51 <+bridge_> [ddnet] 23:51 <+bridge_> [ddnet] ```diff 23:51 <+bridge_> [ddnet] diff --git src/base/system.h src/base/system.h 23:51 <+bridge_> [ddnet] index af617d7ad..133345376 100644 23:51 <+bridge_> [ddnet] --- src/base/system.h 23:51 <+bridge_> [ddnet] +++ src/base/system.h 23:51 <+bridge_> [ddnet] @@ -2423,6 +2423,13 @@ void set_exception_handler_log_file(const char *log_file_path); 23:51 <+bridge_> [ddnet] 23:51 <+bridge_> [ddnet] #if defined(__cplusplus) 23:51 <+bridge_> [ddnet] } 23:51 <+bridge_> [ddnet] + 23:51 <+bridge_> [ddnet] +template 23:51 <+bridge_> [ddnet] +int str_copy(char (&dst)[N], const char *src) 23:51 <+bridge_> [ddnet] +{ 23:51 <+bridge_> [ddnet] + str_copy(dst, src, N); 23:51 <+bridge_> [ddnet] +} 23:51 <+bridge_> [ddnet] + 23:51 <+bridge_> [ddnet] #endif 23:51 <+bridge_> [ddnet] 23:51 <+bridge_> [ddnet] #endif``` 23:52 <+bridge_> [ddnet] 23:52 <+bridge_> [ddnet] We have 477 uses of `str_copy`, mostly stuff like `str_copy(m_Password, pPassword, sizeof(m_Password));`, but sometimes even use hardcoded values: 23:52 <+bridge_> [ddnet] https://github.com/ddnet/ddnet/blob/e14fc102a6f5f4492ab1eb26504642181c6aa933/src/game/client/gameclient.cpp#L1196 23:52 <+bridge_> [ddnet] 23:52 <+bridge_> [ddnet] If we don't want to replace all cases (I think there are at least 300 uses like `str_copy(a, b, sizeof(a))`) then we can at least add such functions and use them in new code. 23:52 <+bridge_> [ddnet] And `str_copy` is not the only case, there are also `str_append(char *dst, const char *src, int dst_size)`, `str_truncate`, `str_hex(char *dst, int dst_size, ...)`, `str_hex_decode(void *dst, int dst_size, ...), 23:52 <+bridge_> [ddnet] For example, we can add a `str_copy` version which 'll get the destination size automatically. 23:52 <+bridge_> [ddnet] 23:52 <+bridge_> [ddnet] ```diff 23:52 <+bridge_> [ddnet] diff --git src/base/system.h src/base/system.h 23:52 <+bridge_> [ddnet] index af617d7ad..133345376 100644 23:52 <+bridge_> [ddnet] --- src/base/system.h 23:52 <+bridge_> [ddnet] +++ src/base/system.h 23:52 <+bridge_> [ddnet] @@ -2423,6 +2423,13 @@ void set_exception_handler_log_file(const char *log_file_path); 23:52 <+bridge_> [ddnet] 23:52 <+bridge_> [ddnet] @Kaffeine how does that work? The compiler tracks the size of the buffer? 23:52 <+bridge_> [ddnet] For example, we can add a `str_copy` version which 'll get the destination size automatically. 23:52 <+bridge_> [ddnet] 23:52 <+bridge_> [ddnet] ```diff 23:52 <+bridge_> [ddnet] diff --git src/base/system.h src/base/system.h 23:52 <+bridge_> [ddnet] index af617d7ad..133345376 100644 23:52 <+bridge_> [ddnet] --- src/base/system.h 23:52 <+bridge_> [ddnet] +++ src/base/system.h 23:52 <+bridge_> [ddnet] @@ -2423,6 +2423,13 @@ void set_exception_handler_log_file(const char *log_file_path); 23:52 <+bridge_> [ddnet] 23:52 <+bridge_> [ddnet] #if defined(__cplusplus) 23:53 <+bridge_> [ddnet] } 23:53 <+bridge_> [ddnet] + 23:53 <+bridge_> [ddnet] +template 23:53 <+bridge_> [ddnet] +int str_copy(char (&dst)[N], const char *src) 23:53 <+bridge_> [ddnet] +{ 23:54 <+bridge> [ddnet] We can declare template functions which works with array of `N` characters, where `N` is figured out by compiler from the variable type; at compile time. 23:57 <+bridge> [ddnet] The compiler just know the type of passed variable. 23:57 <+bridge> [ddnet] 23:57 <+bridge> [ddnet] In 23:57 <+bridge> [ddnet] ```cpp 23:57 <+bridge> [ddnet] char aNameTry[MAX_NAME_LENGTH]; 23:58 <+bridge> [ddnet] str_copy(aNameTry, aTrimmedName, sizeof(aNameTry)); 23:58 <+bridge> [ddnet] ``` 23:58 <+bridge> [ddnet] the type of `aNameTry` is `char[16]`. Our new `str_copy()` can accept `char[N]` as the first argument and know the `N` at compile time. 23:59 <+bridge> [ddnet] Does it still track it when `char *pBuf = aNameTry; ` and then use pBuf? 23:59 <+bridge> [ddnet] I guess not, so we'll definitely still need the old way too