Skip to content

Commit

Permalink
Use TCitizen for struct passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
algernon-A committed May 25, 2023
1 parent 57f820f commit db416a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/RealTime/CustomAI/RealTimeTouristAI.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="RealTimeTouristAI.cs" company="dymanoid">
// <copyright file="RealTimeTouristAI.cs" company="dymanoid">
// Copyright (c) dymanoid. All rights reserved.
// </copyright>

Expand Down Expand Up @@ -255,7 +255,7 @@ when BuildingMgr.GetBuildingSubService(visitBuilding) == ItemClass.SubService.Co

private void FindRandomVisitPlace(TAI instance, uint citizenId, ref TCitizen citizen, int doNothingProbability, ushort currentBuilding)
{
var target = (TouristTarget)touristAI.GetRandomTargetType(instance, doNothingProbability, ref Singleton<CitizenManager>.instance.m_citizens.m_buffer[citizenId]);
var target = (TouristTarget)touristAI.GetRandomTargetType(instance, doNothingProbability, ref citizen);
target = AdjustTargetToTimeAndWeather(ref citizen, target);

switch (target)
Expand Down
5 changes: 3 additions & 2 deletions src/RealTime/GameConnection/TouristAIConnection.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="TouristAIConnection.cs" company="dymanoid">
// <copyright file="TouristAIConnection.cs" company="dymanoid">
// Copyright (c) dymanoid. All rights reserved.
// </copyright>

Expand Down Expand Up @@ -51,8 +51,9 @@ public TouristAIConnection(
/// </summary>
/// <param name="instance">The AI instance the method is called on.</param>
/// <param name="doNothingProbability">A value that specified a probability that the citizen will do nothing.</param>
/// <param name="data">The refernece to the citizen struct for this instance.</param>
/// <returns>A value specifying the citizen's next action: 0 for idle, 1 for leaving the city, 2 for shopping, 3 for entertainment.</returns>
public delegate TouristAI.Target GetRandomTargetTypeDelegate(TAI instance, int doNothingProbability, ref Citizen data);
public delegate TouristAI.Target GetRandomTargetTypeDelegate(TAI instance, int doNothingProbability, ref TCitizen data);

/// <summary>
/// Represents the method that corresponds to the AI's original <c>GetLeavingReason</c> method.
Expand Down

0 comments on commit db416a9

Please sign in to comment.