1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 20:43:04 +01:00

Added peep_insert_new_thought

This commit is contained in:
Duncan Frost
2014-09-17 17:43:57 +01:00
parent 11c4ac52ac
commit 95557bc732
3 changed files with 54 additions and 2 deletions

View File

@@ -225,7 +225,7 @@ static void peep_update(rct_peep *peep)
if (peep->var_7A >= 3500 && (0xFFFF & scenario_rand()) <= 93)
{
//Create the ive been waiting in line ages thought
RCT2_CALLPROC_X(0x699F5A, (peep->current_ride << 8) | PEEP_THOUGHT_TYPE_QUEUING_AGES, 0, 0, 0, (int)peep, 0, 0);
peep_insert_new_thought(peep, PEEP_THOUGHT_TYPE_QUEUING_AGES, peep->current_ride);
}
}
else{
@@ -869,3 +869,46 @@ int peep_is_mechanic(rct_peep *peep)
peep->staff_type == STAFF_TYPE_MECHANIC
);
}
/**
* rct2: 0x699F5A
* al:thought_type
* ah:thought_arguments
* esi: peep
*/
void peep_insert_new_thought(rct_peep *peep, uint8 thought_type, uint8 thought_arguments){
int var_71 = RCT2_ADDRESS(0x981DB0, uint16)[thought_type];
if (var_71 != 0xFF && peep->var_71 >= 254){
peep->var_71 = var_71;
peep->var_72 = 0;
peep->var_70 = 0;
RCT2_CALLPROC_X(0x693B58, 0, 0, 0, 0, (int)peep, 0, 0);
RCT2_CALLPROC_X(0x6EC473, 0, 0, 0, 0, (int)peep, 0, 0);
}
for (int i = 0; i < PEEP_MAX_THOUGHTS; ++i){
rct_peep_thought* thought = &peep->thoughts[i];
if (thought->type == PEEP_THOUGHT_TYPE_NONE) break;
if (thought->type == thought_type && thought->item == thought_arguments){
for (int j = i; j < PEEP_MAX_THOUGHTS; ++j){
if (j == PEEP_MAX_THOUGHTS - 1){
peep->thoughts[j].type = PEEP_THOUGHT_TYPE_NONE;
break;
}
peep->thoughts[j] = peep->thoughts[j + 1];
}
}
}
memmove(&peep->thoughts[1], &peep->thoughts[0], sizeof(rct_peep_thought)*(PEEP_MAX_THOUGHTS - 1));
peep->thoughts[0].type = thought_type;
peep->thoughts[0].item = thought_arguments;
peep->thoughts[0].var_2 = 0;
peep->thoughts[0].var_3 = 0;
peep->var_45 |= (1 << 0);
}

View File

@@ -495,4 +495,12 @@ int peep_check_easteregg_name(int index, rct_peep *peep);
int peep_get_easteregg_name_id(rct_peep *peep);
int peep_is_mechanic(rct_peep *peep);
/**
* rct2: 0x699F5A
* al:thought_type
* ah:thought_arguments
* esi: peep
*/
void peep_insert_new_thought(rct_peep *peep, uint8 thought_type, uint8 thought_arguments);
#endif

View File

@@ -1098,7 +1098,8 @@ void window_guest_overview_update(rct_window* w){
int rand = scenario_rand() & 0xFFFF;
if (rand <= 0x2AAA){
rct_peep* peep = GET_PEEP(w->number);
RCT2_CALLPROC_X(0x699F5A, 0xFF00 | PEEP_THOUGHT_TYPE_WATCHED, 0, 0, 0, (int)peep, 0, 0);
peep_insert_new_thought(peep, PEEP_THOUGHT_TYPE_WATCHED, 0xFF);
//RCT2_CALLPROC_X(0x699F5A, 0xFF00 | PEEP_THOUGHT_TYPE_WATCHED, 0, 0, 0, (int)peep, 0, 0);
}
}
}