Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
9 years ago
Diff never expires
Clear
Export
Share
Explain
0 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
85 lines
Copy
18 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
103 lines
Copy
std::string Player::getDescription(int32_t lookDistance) const
std::string Player::getDescription(int32_t lookDistance) const
{
{
std::ostringstream s;
std::ostringstream s;
if (lookDistance == -1) {
if (lookDistance == -1) {
s << "yourself.";
s << "yourself.";
if (group->access) {
if (group->access) {
s << " You are " << group->name << '.';
s << " You are " << group->name << '.';
} else if (vocation->getId() != VOCATION_NONE) {
} else if (vocation->getId() != VOCATION_NONE) {
s << " You are " << vocation->getVocDescription() << '.';
s << " You are " << vocation->getVocDescription() << '.';
} else {
} else {
s << " You have no vocation.";
s << " You have no vocation.";
}
}
Copy
Copied
Copy
Copied
//custom edit: passive damage bonus
if (passiveDamageBonus > 0)
{
s << " Your passive damage bonus is " << passiveDamageBonus << "%.";
}
} else {
} else {
s << name;
s << name;
if (!group->access) {
if (!group->access) {
s << " (Level " << level << ')';
s << " (Level " << level << ')';
}
}
s << '.';
s << '.';
if (sex == PLAYERSEX_FEMALE) {
if (sex == PLAYERSEX_FEMALE) {
s << " She";
s << " She";
} else {
} else {
s << " He";
s << " He";
}
}
if (group->access) {
if (group->access) {
s << " is " << group->name << '.';
s << " is " << group->name << '.';
} else if (vocation->getId() != VOCATION_NONE) {
} else if (vocation->getId() != VOCATION_NONE) {
s << " is " << vocation->getVocDescription() << '.';
s << " is " << vocation->getVocDescription() << '.';
} else {
} else {
s << " has no vocation.";
s << " has no vocation.";
}
}
Copy
Copied
Copy
Copied
//custom edit: passive damage bonus
if (passiveDamageBonus > 0)
{
if (sex == PLAYERSEX_FEMALE) {
s << " Her";
}
else {
s << " His";
}
s << " passive damage bonus is " << passiveDamageBonus << "%.";
}
}
}
if (party) {
if (party) {
if (lookDistance == -1) {
if (lookDistance == -1) {
s << " Your party has ";
s << " Your party has ";
} else if (sex == PLAYERSEX_FEMALE) {
} else if (sex == PLAYERSEX_FEMALE) {
s << " She is in a party with ";
s << " She is in a party with ";
} else {
} else {
s << " He is in a party with ";
s << " He is in a party with ";
}
}
size_t memberCount = party->getMemberCount() + 1;
size_t memberCount = party->getMemberCount() + 1;
if (memberCount == 1) {
if (memberCount == 1) {
s << "1 member and ";
s << "1 member and ";
} else {
} else {
s << memberCount << " members and ";
s << memberCount << " members and ";
}
}
size_t invitationCount = party->getInvitationCount();
size_t invitationCount = party->getInvitationCount();
if (invitationCount == 1) {
if (invitationCount == 1) {
s << "1 pending invitation.";
s << "1 pending invitation.";
} else {
} else {
s << invitationCount << " pending invitations.";
s << invitationCount << " pending invitations.";
}
}
}
}
if (!guild || !guildRank) {
if (!guild || !guildRank) {
return s.str();
return s.str();
}
}
if (lookDistance == -1) {
if (lookDistance == -1) {
s << " You are ";
s << " You are ";
} else if (sex == PLAYERSEX_FEMALE) {
} else if (sex == PLAYERSEX_FEMALE) {
s << " She is ";
s << " She is ";
} else {
} else {
s << " He is ";
s << " He is ";
}
}
s << guildRank->name << " of the " << guild->getName();
s << guildRank->name << " of the " << guild->getName();
if (!guildNick.empty()) {
if (!guildNick.empty()) {
s << " (" << guildNick << ')';
s << " (" << guildNick << ')';
}
}
size_t memberCount = guild->getMemberCount();
size_t memberCount = guild->getMemberCount();
if (memberCount == 1) {
if (memberCount == 1) {
s << ", which has 1 member, " << guild->getMembersOnline().size() << " of them online.";
s << ", which has 1 member, " << guild->getMembersOnline().size() << " of them online.";
} else {
} else {
s << ", which has " << memberCount << " members, " << guild->getMembersOnline().size() << " of them online.";
s << ", which has " << memberCount << " members, " << guild->getMembersOnline().size() << " of them online.";
}
}
return s.str();
return s.str();
}
}
Saved diffs
Original text
Open file
std::string Player::getDescription(int32_t lookDistance) const { std::ostringstream s; if (lookDistance == -1) { s << "yourself."; if (group->access) { s << " You are " << group->name << '.'; } else if (vocation->getId() != VOCATION_NONE) { s << " You are " << vocation->getVocDescription() << '.'; } else { s << " You have no vocation."; } } else { s << name; if (!group->access) { s << " (Level " << level << ')'; } s << '.'; if (sex == PLAYERSEX_FEMALE) { s << " She"; } else { s << " He"; } if (group->access) { s << " is " << group->name << '.'; } else if (vocation->getId() != VOCATION_NONE) { s << " is " << vocation->getVocDescription() << '.'; } else { s << " has no vocation."; } } if (party) { if (lookDistance == -1) { s << " Your party has "; } else if (sex == PLAYERSEX_FEMALE) { s << " She is in a party with "; } else { s << " He is in a party with "; } size_t memberCount = party->getMemberCount() + 1; if (memberCount == 1) { s << "1 member and "; } else { s << memberCount << " members and "; } size_t invitationCount = party->getInvitationCount(); if (invitationCount == 1) { s << "1 pending invitation."; } else { s << invitationCount << " pending invitations."; } } if (!guild || !guildRank) { return s.str(); } if (lookDistance == -1) { s << " You are "; } else if (sex == PLAYERSEX_FEMALE) { s << " She is "; } else { s << " He is "; } s << guildRank->name << " of the " << guild->getName(); if (!guildNick.empty()) { s << " (" << guildNick << ')'; } size_t memberCount = guild->getMemberCount(); if (memberCount == 1) { s << ", which has 1 member, " << guild->getMembersOnline().size() << " of them online."; } else { s << ", which has " << memberCount << " members, " << guild->getMembersOnline().size() << " of them online."; } return s.str(); }
Changed text
Open file
std::string Player::getDescription(int32_t lookDistance) const { std::ostringstream s; if (lookDistance == -1) { s << "yourself."; if (group->access) { s << " You are " << group->name << '.'; } else if (vocation->getId() != VOCATION_NONE) { s << " You are " << vocation->getVocDescription() << '.'; } else { s << " You have no vocation."; } //custom edit: passive damage bonus if (passiveDamageBonus > 0) { s << " Your passive damage bonus is " << passiveDamageBonus << "%."; } } else { s << name; if (!group->access) { s << " (Level " << level << ')'; } s << '.'; if (sex == PLAYERSEX_FEMALE) { s << " She"; } else { s << " He"; } if (group->access) { s << " is " << group->name << '.'; } else if (vocation->getId() != VOCATION_NONE) { s << " is " << vocation->getVocDescription() << '.'; } else { s << " has no vocation."; } //custom edit: passive damage bonus if (passiveDamageBonus > 0) { if (sex == PLAYERSEX_FEMALE) { s << " Her"; } else { s << " His"; } s << " passive damage bonus is " << passiveDamageBonus << "%."; } } if (party) { if (lookDistance == -1) { s << " Your party has "; } else if (sex == PLAYERSEX_FEMALE) { s << " She is in a party with "; } else { s << " He is in a party with "; } size_t memberCount = party->getMemberCount() + 1; if (memberCount == 1) { s << "1 member and "; } else { s << memberCount << " members and "; } size_t invitationCount = party->getInvitationCount(); if (invitationCount == 1) { s << "1 pending invitation."; } else { s << invitationCount << " pending invitations."; } } if (!guild || !guildRank) { return s.str(); } if (lookDistance == -1) { s << " You are "; } else if (sex == PLAYERSEX_FEMALE) { s << " She is "; } else { s << " He is "; } s << guildRank->name << " of the " << guild->getName(); if (!guildNick.empty()) { s << " (" << guildNick << ')'; } size_t memberCount = guild->getMemberCount(); if (memberCount == 1) { s << ", which has 1 member, " << guild->getMembersOnline().size() << " of them online."; } else { s << ", which has " << memberCount << " members, " << guild->getMembersOnline().size() << " of them online."; } return s.str(); }
Find difference