funny comments on source code

Discussions about modding, questions, mod requests or just show off what you're working on.
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

funny comments on source code

Post by Tr!Force »

I wanted to do this a long time ago hehe :) , there is a list of some comments i found in the internal jk2 source code.

(Comments are like an "invisible" text which developers left to make suggestions, ideas, or descriptions above a piece of code)
//WTF???
//?????
//sigh..
//err..
//err?
//Ah, well..
//?! (bad)
//Bad!
//Yay!
//DONE!
//something has gone very wrong (this should never happen)
//you are mine, now!
//we could be more elegant about this, but oh well.
//Good guys are always on "alert"
//magical numbers make magic happen
// yes, this is completely ridiculous...
// well, we must die now
// this is kinda dirty, but...
// i am a dead corpse
// None for you, sir!
// This is nasty..
// get hard... huh-huh...
PD: i know there are more, but these are only some i found arround the things i worked :lol:
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: funny comments on source code

Post by ouned »

you dont want to see what sort of things i wrote back when i was ~16
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: funny comments on source code

Post by Tr!Force »

ouned wrote:you dont want to see what sort of things i wrote back when i was ~16
haha same here, is funny how lead jk2 developers remained respectful comments :? mine are alots of "fuck this!, plz fix this stupid thing!, etc..." :lol:
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: funny comments on source code

Post by Tr!Force »

Hahaha loool that is a good way to search :D

So ... Most of the first things are from mp3code, that stuff isnt from the jk2 dev team i think...

Anyways, the rest is very funny :P
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
Kazuka
Moderator
Posts: 260
Joined: 10 Aug 2015, 20:30

Re: funny comments on source code

Post by Kazuka »

lol :D
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: funny comments on source code

Post by ouned »

unrelated but look at that:
https://github.com/torvalds/linux/searc ... &type=Code

Code: Select all

#define	DA9055_VBMEM_SEL_SHIT		0x04
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: funny comments on source code

Post by Tr!Force »

ouned wrote:unrelated but look at that:
https://github.com/torvalds/linux/searc ... &type=Code

Code: Select all

#define	DA9055_VBMEM_SEL_SHIT		0x04
LOL haha, is understandable in comments, but.. ¿using it in variables?. i think that guy love that word a lot :lol: i laughed alot with this:

Code: Select all

/* !!!! THIS IS A PIECE OF SHIT MADE BY ME !!! */
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: funny comments on source code

Post by Daggolin »

I recently greped the linux kernel source for such terms. It's quite interesting, there is printk calls with "wtf?" as message or quite interesting panic calls. :D

Back to JK2:

Code: Select all

{ //The match has a valid instance (if it didn't, we'd probably already be fudged (^_^) at this state)
And now actual code (not just comments):

Code: Select all

	if (!(*ghoul2Ptr))
	{
		*ghoul2Ptr = new CGhoul2Info_v;
		if (RicksCrazyOnServer)
		{
			OkLetsFixTheLeaksTheEasyWay[1].insert(*ghoul2Ptr);
		}
		else
		{
			OkLetsFixTheLeaksTheEasyWay[0].insert(*ghoul2Ptr);
		}
	}
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: funny comments on source code

Post by Tr!Force »

Daggolin wrote:I recently greped the linux kernel source for such terms. It's quite interesting, there is printk calls with "wtf?" as message or quite interesting panic calls. :D

Back to JK2:

Code: Select all

{ //The match has a valid instance (if it didn't, we'd probably already be fudged (^_^) at this state)
And now actual code (not just comments):

Code: Select all

	if (!(*ghoul2Ptr))
	{
		*ghoul2Ptr = new CGhoul2Info_v;
		if (RicksCrazyOnServer)
		{
			OkLetsFixTheLeaksTheEasyWay[1].insert(*ghoul2Ptr);
		}
		else
		{
			OkLetsFixTheLeaksTheEasyWay[0].insert(*ghoul2Ptr);
		}
	}
lol thats in the engine/ghoul api right? there are more weird stuff in the engine code instead the game code :lol:
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: funny comments on source code

Post by Tr!Force »

lol thats in the engine/ghoul api right? there are more weird stuff in the engine code instead the game code :lol:
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: funny comments on source code

Post by ouned »

yeah it is. But i replaced it when fixing the ghoul code for 64bit & q3vm support
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: funny comments on source code

Post by fau »

Jungle DRM :-(

Code: Select all

void CL_MakeMonkeyDoLaundry( void ) {
        if ( Sys_MonkeyShouldBeSpanked() ) {
                if ( !(cls.framecount & 255) ) {
                        if ( random() < 0.1 ) {
                                CL_ChangeReliableCommand();
                        }
                }
        }
}
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: funny comments on source code

Post by Daggolin »

Ah, the monkeyspank thing. lol
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: funny comments on source code

Post by fau »

Code: Select all

        char sTiedFor[64];      // german is much longer, super safe...
        (…)
        trap_SP_GetStringTextString("INGAMETEXT_TIED_FOR" ,sTiedFor,sizeof(sTiedFor) );
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: funny comments on source code

Post by Tr!Force »

lol super safe

:lol:
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: funny comments on source code

Post by fau »

Code: Select all

qboolean CalculateSection31Award(gentity_t *ent)
{
(…)
             if (strcmp("JaxxonPhred", ent->client->pers.netname))
             {
                       continue;
             }
(…)
}
I've seen some more strcmp with specific netnames trolling, but can't find them right now
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: funny comments on source code

Post by Daggolin »

That one?

Code: Select all

//if(self.classname!="monster_mezzoman"&&self.netname!="spider")//Cats always land on their feet
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Re: funny comments on source code

Post by Boothand »

Did the developers troll other devs by excluding them by ingame-name from.. something? Awards? :D
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: funny comments on source code

Post by Daggolin »

Possible, but the codepieces that had name-dependant behaviour were all commented out as far as I can tell. ;)
In the code-release at least. :mrgreen:
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: funny comments on source code

Post by fau »

Well, that's what the topic says, funny comments on source code :P

@ouned exactly.
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: funny comments on source code

Post by Daggolin »

Code: Select all

	/*
	if (fpDisabled)
	{
		final_Powers[FP_LEVITATION] = 1;
		final_Powers[FP_SABERATTACK] = 3;
		final_Powers[FP_SABERDEFEND] = 3;
		final_Powers[FP_SABERTHROW] = 0;
	}
	*/
	//Ahh. I have no idea why I did this, but I would say that it makes me a very bad man.
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: funny comments on source code

Post by Tr!Force »

Daggolin wrote:

Code: Select all

	/*
	if (fpDisabled)
	{
		final_Powers[FP_LEVITATION] = 1;
		final_Powers[FP_SABERATTACK] = 3;
		final_Powers[FP_SABERDEFEND] = 3;
		final_Powers[FP_SABERTHROW] = 0;
	}
	*/
	//Ahh. I have no idea why I did this, but I would say that it makes me a very bad man.

LOL :lol: hes a very bad man
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: funny comments on source code

Post by Daggolin »

Tr!Force wrote:
Daggolin wrote:

Code: Select all

	/*
	if (fpDisabled)
	{
		final_Powers[FP_LEVITATION] = 1;
		final_Powers[FP_SABERATTACK] = 3;
		final_Powers[FP_SABERDEFEND] = 3;
		final_Powers[FP_SABERTHROW] = 0;
	}
	*/
	//Ahh. I have no idea why I did this, but I would say that it makes me a very bad man.

LOL :lol: hes a very bad man
That codepiece made be add a stupid cvar to the mvsdk:

Code: Select all

	if ( (jk2version == VERSION_1_02 && mv_forcePowerDisableMode.integer) )
	{ // The 1.02 client doesn't show the force selection menu if ANY force power is disabled. Some servers might be running on a power-set that disables all powers, except those three. Basejk clients might get a handicap then, cause they can't set their powers and might end up with weaker attack/defense than other players. Servers should only disable this on 1.02, if they know what they're doing.
		if (fpDisabled)
		{
			final_Powers[FP_LEVITATION] = 1;
			final_Powers[FP_SABERATTACK] = 3;
			final_Powers[FP_SABERDEFEND] = 3;
			final_Powers[FP_SABERTHROW] = 0;
		}
	}
	else
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: funny comments on source code

Post by Tr!Force »

Daggolin wrote:
Tr!Force wrote:
Daggolin wrote:

Code: Select all

	/*
	if (fpDisabled)
	{
		final_Powers[FP_LEVITATION] = 1;
		final_Powers[FP_SABERATTACK] = 3;
		final_Powers[FP_SABERDEFEND] = 3;
		final_Powers[FP_SABERTHROW] = 0;
	}
	*/
	//Ahh. I have no idea why I did this, but I would say that it makes me a very bad man.

LOL :lol: hes a very bad man
That codepiece made be add a stupid cvar to the mvsdk:

Code: Select all

	if ( (jk2version == VERSION_1_02 && mv_forcePowerDisableMode.integer) )
	{ // The 1.02 client doesn't show the force selection menu if ANY force power is disabled. Some servers might be running on a power-set that disables all powers, except those three. Basejk clients might get a handicap then, cause they can't set their powers and might end up with weaker attack/defense than other players. Servers should only disable this on 1.02, if they know what they're doing.
		if (fpDisabled)
		{
			final_Powers[FP_LEVITATION] = 1;
			final_Powers[FP_SABERATTACK] = 3;
			final_Powers[FP_SABERDEFEND] = 3;
			final_Powers[FP_SABERTHROW] = 0;
		}
	}
	else
LOL, i thought that code piece was requiried in another place or version :lol:

offtopic: how mvsdk is going? im tired to copy & paste same mod code in 1.02 and 1.04 sources :?
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
Post Reply
Created by Matti from StylesFactory.pl and Warlords of Draenor (modified by jk2.info)
Powered by phpBB® Forum Software © phpBB Limited