PDA

View Full Version : GENERAL: For Laughs


ahenobarb
November 10, 2003, 14:41
Found these while looking through the code and just had to share:

Happy.cpp

void Happy::SetFullHappinessTurns(sint32 turns)
{
m_fullHappinessTurns = turns;
m_happiness = 100;
m_tracker->ClearEntries(HAPPY_REASON_SMOKING_CRACK,
HAPPY_REASON_MAX);
}


in armydata.cpp

BOOL g_smokingCrack = TRUE;



:lol:

centrifuge
November 10, 2003, 14:50
:lol::lol::lol:

NelsonAndBronte
November 10, 2003, 14:58
In fscompete.cpp


attack_the_bastard = new GoalAttack(ai, him, pos);

Keygen
November 10, 2003, 16:26
:lol:

:hmmm: This looks like Winnie's variable naming style :p

The Big Mc
November 10, 2003, 17:37
:lol: :lol: :lol: what do activision pay there programmes :lol: :lol:

on second thought probably peanuts

The Big Mc
November 10, 2003, 17:37
Why the hell did this post three times:D

The Big Mc
November 10, 2003, 17:37
:dp

Asmodean
November 11, 2003, 18:04
Yeah...this has st_swithin written all over it ;)

Asmodean

child of Thor
November 12, 2003, 06:25
Originally posted by The Big Mc
:lol: :lol: :lol: what do activision pay there programmes :lol: :lol:

on second thought probably peanuts

:lol: Obviously too much if they can afford to smoke crack? ;)
Drugs are Bad - especially beer ;) :cute:

But good to see the team were keeping their spirits up in those dark times - i'm sure a few more gems will be unearthed for our asmusement:cool:

The Big Mc
November 12, 2003, 06:41
Originally posted by child of Thor


Drugs are Bad - especially beer ;) :cute:



beer is good beeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeer

emmm beeeeeeeeeeeeeeeeer:Party:

uppi
November 12, 2003, 13:28
in ui/interface/helptile.h


#ifndef THIS_IS_MY_CONSTANT_SO_YOU_BETTER_NOT_USE_IT
#define THIS_IS_MY_CONSTANT_SO_YOU_BETTER_NOT_USE_IT


I guess they had _some_ problems with the naming of their constants...

The Big Mc
November 23, 2003, 08:27
if(!city.GetData()->GetCityData()->CapturedThisTurn()) {
if(g_network.IsClient()) {
g_network.RequestResync(RESYNC_PROBABLE_CHEATER);
}
return SFN_ERROR_OK;
}


Charming:D

Martin Gühmann
November 23, 2003, 14:09
Originally posted by The Big Mc

if(!city.GetData()->GetCityData()->CapturedThisTurn()) {
if(g_network.IsClient()) {
g_network.RequestResync(RESYNC_PROBABLE_CHEATER);
}
return SFN_ERROR_OK;
}


Charming:D

From where did you get it, Big MC? Looks like here is the reason why my City Capture options doesn't work in MP.

-Martin

Peter Triggs
November 23, 2003, 14:25
Martin,

It's in slicfunc.cpp:


SFN_ERROR Slic_DoFreeSlaves::Call(SlicArgList *args)
{
if (args->m_numArgs > 0)
return SFN_ERROR_NUM_ARGS;

Unit city = g_slicEngine->GetContext()->GetCity(0);

if(!g_theUnitPool->IsValid(city)) {
return SFN_ERROR_OK;
}

if(!city.GetData()->GetCityData()->CapturedThisTurn()) {
if(g_network.IsClient()) {
g_network.RequestResync(RESYNC_PROBABLE_CHEATER);
}
return SFN_ERROR_OK;
}

if(g_network.IsClient()) {
g_network.SendAction(new NetAction(NET_ACTION_FREE_SLAVES, city.m_id));
}

city.FreeSlaves();

return SFN_ERROR_OK;
}


I noticed it yesterday and was going to suggest that either you or JohnBTW might want to modify it so that slaves could be freed not just on the turn that the city is captured. I couldn't find any other occurence of 'RESYNC_PROBABLE_CHEATER' in a .cpp file, but it sounds like it was intended to be some kind of defense against multiplayer cheating.

Martin Gühmann
November 23, 2003, 14:46
Yes it is the only occurence in a *.cpp file, for changing it I would like to keep the current function, when there are zero arguments. If there is one argument and it is a city the slaves should be freed.

And Peter why don't you play with the slic functions on your own then you might find out some usefull stuff. To alter this slic function you can basicly find everything you need in that file, just check the other functions.

-Martin

Peter Triggs
November 23, 2003, 15:05
I'm working on diplomacy. It's very 'challenging'. :sigh:

I think I've found the place where AI-AI diplomacy gets 'shut down', but the system is very complicated and I'm still trying to figure out how it works.

The Big Mc
November 23, 2003, 16:22
i have all ready worked out the code for a new function called free al slaves :D

i did it this afternoon before the post :D

Martin Gühmann
November 24, 2003, 12:17
Originally posted by The Big Mc
i have all ready worked out the code for a new function called free al slaves :D

i did it this afternoon before the post :D

So and where is your code?

But actual I prefer the concept of overloading.

-Martin

The Big Mc
November 24, 2003, 17:05
SFN_ERROR Slic_FreeAllSlaves::Call(SlicArgList *args)
{
if (args->m_numArgs > 0)
return SFN_ERROR_NUM_ARGS;

Unit city = g_slicEngine->GetContext()->GetCity(0);

if(!g_theUnitPool->IsValid(city)) {
return SFN_ERROR_OK;
}

if(g_network.IsClient())
{
g_network.SendAction(new NetAction(NET_ACTION_FREE_SLAVES, city.m_id));
}

city.FreeSlaves();
return SFN_ERROR_OK;
}

it compiles no errors but i haven’t got it to run in game yet:D

i also add it as an attachment as part of the full files modified i copied onto the one you did for ctp 2 patch :D

closms
November 27, 2003, 17:45
MapPoint ISuck = point;

Martin Gühmann
August 20, 2004, 16:12
Another one from CityData.cpp:


void CityData::AddEndGameObject(sint32 type)
{
bool wtf = false;
Assert(wtf);
}


-Martin

child of Thor
August 20, 2004, 16:29
Wow! nealry a whole year and thats all you could find! :D

St.swithin must have been slowing down ;)

Martin Gühmann
September 10, 2004, 11:22
And another one at least one to smile. :)


#ifdef _DEBUG
bool RICHARD_WANTS_TO_SEE_THIS_ASSERT = (type > -1);
Assert(RICHARD_WANTS_TO_SEE_THIS_ASSERT);
#endif


Looks like a problem with not popping up asserts maybe he should have compiled the game in debug mode.

-Martin

child of Thor
September 10, 2004, 13:48
:lol:

I can almost picture the scene:

Late at night with three empty coffee cups near at hand, bag of crisps, bits of paper and some big fat books about technical computer stuff.

And one annoying bit of code that isn't doing what its meant to do ;)

oh the joys of being a programmer! :D

Martin Gühmann
September 11, 2004, 13:45
And another one this time from CivilisationDB.cpp:


#ifdef _DEBUG
if(!(rand() % 10000)) {
static saidItOnce = FALSE;
if(!saidItOnce && strstr(g_theStringDB->GetNameStr(str_id), "WarMany")) {
c3errors_ErrorDialog("Designer", "I don't like these civilization names");
saidItOnce = TRUE;
}
}
#endif


-Martin